summaryrefslogtreecommitdiff
path: root/keystore/java/android/security/KeyStoreKeySpec.java
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-05-11 12:30:03 -0700
committerAlex Klyubin <klyubin@google.com>2015-05-11 12:30:03 -0700
commit54bb1596e470144932943046ec7a99551d020ba0 (patch)
tree30fa51b740d3e0a09fb54d16077f4a80a4682420 /keystore/java/android/security/KeyStoreKeySpec.java
parente1176f10eba5a65ad23877b210e4d8d886653e6e (diff)
Add NonNull and Nullable annotations to AndroidKeyStore API.
This is to enable Android Lint and Android Studio to flag nullness issues at compile time. Bug: 18088752 Change-Id: I21033b8fcdd989d08c89b50685e47fbb9c74acbf
Diffstat (limited to 'keystore/java/android/security/KeyStoreKeySpec.java')
-rw-r--r--keystore/java/android/security/KeyStoreKeySpec.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/keystore/java/android/security/KeyStoreKeySpec.java b/keystore/java/android/security/KeyStoreKeySpec.java
index 0a9acbb43698..81a19bb55755 100644
--- a/keystore/java/android/security/KeyStoreKeySpec.java
+++ b/keystore/java/android/security/KeyStoreKeySpec.java
@@ -16,6 +16,9 @@
package android.security;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+
import java.security.PrivateKey;
import java.security.spec.KeySpec;
import java.util.Date;
@@ -150,6 +153,7 @@ public class KeyStoreKeySpec implements KeySpec {
*
* @return instant or {@code null} if not restricted.
*/
+ @Nullable
public Date getKeyValidityStart() {
return mKeyValidityStart;
}
@@ -159,6 +163,7 @@ public class KeyStoreKeySpec implements KeySpec {
*
* @return instant or {@code null} if not restricted.
*/
+ @Nullable
public Date getKeyValidityForConsumptionEnd() {
return mKeyValidityForConsumptionEnd;
}
@@ -168,6 +173,7 @@ public class KeyStoreKeySpec implements KeySpec {
*
* @return instant or {@code null} if not restricted.
*/
+ @Nullable
public Date getKeyValidityForOriginationEnd() {
return mKeyValidityForOriginationEnd;
}
@@ -182,6 +188,7 @@ public class KeyStoreKeySpec implements KeySpec {
/**
* Gets the set of block modes with which the key can be used.
*/
+ @NonNull
public @KeyStoreKeyProperties.BlockModeEnum String[] getBlockModes() {
return ArrayUtils.cloneIfNotEmpty(mBlockModes);
}
@@ -189,6 +196,7 @@ public class KeyStoreKeySpec implements KeySpec {
/**
* Gets the set of padding modes with which the key can be used when encrypting/decrypting.
*/
+ @NonNull
public @KeyStoreKeyProperties.EncryptionPaddingEnum String[] getEncryptionPaddings() {
return ArrayUtils.cloneIfNotEmpty(mEncryptionPaddings);
}
@@ -196,6 +204,7 @@ public class KeyStoreKeySpec implements KeySpec {
/**
* Gets the set of padding modes with which the key can be used when signing/verifying.
*/
+ @NonNull
public @KeyStoreKeyProperties.SignaturePaddingEnum String[] getSignaturePaddings() {
return ArrayUtils.cloneIfNotEmpty(mSignaturePaddings);
}
@@ -203,6 +212,7 @@ public class KeyStoreKeySpec implements KeySpec {
/**
* Gets the set of digest algorithms with which the key can be used.
*/
+ @NonNull
public @KeyStoreKeyProperties.DigestEnum String[] getDigests() {
return ArrayUtils.cloneIfNotEmpty(mDigests);
}