CogniCrypt
CogniCrypt copied to clipboard
CrySL Rule for KeyGenParameterSpec
Look at the class KeyGenParameterSpec[1] and create a CrySL rule for it This article is a good starting point for a general overview: https://medium.com/@ericfu/securely-storing-secrets-in-an-android-application-501f030ae5a3
[1] https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.html
The name of this class in CrySL must be android.security.keystore.KeyGenParameterSpec.Builder. Without the Builder at the end. the set methods (e.g. setKeySize) throw an error (Couldn't resolve reference to JvmExecutable 'setKeySize'.) cause they are not in KeyGenParameterSpec class but in the builder. On the other hand, when using this class in a project, it will be imported as android.security.keystore.KeyGenParameterSpec, and when analysing by SAST it does not consider it as a used rule cause the rule SPEC name is, android.security.keystore.KeyGenParameterSpec.Builder.