diff options
Diffstat (limited to 'luni/src/main/java/javax/crypto')
-rw-r--r-- | luni/src/main/java/javax/crypto/Cipher.java | 16 | ||||
-rw-r--r-- | luni/src/main/java/javax/crypto/KeyAgreement.java | 12 | ||||
-rw-r--r-- | luni/src/main/java/javax/crypto/Mac.java | 12 |
3 files changed, 40 insertions, 0 deletions
diff --git a/luni/src/main/java/javax/crypto/Cipher.java b/luni/src/main/java/javax/crypto/Cipher.java index 66d03ad..225822d 100644 --- a/luni/src/main/java/javax/crypto/Cipher.java +++ b/luni/src/main/java/javax/crypto/Cipher.java @@ -374,6 +374,22 @@ public class Cipher { } /** + * Returns the {@code CipherSpi} backing this {@code Cipher} or {@code null} if no + * {@code CipherSpi} is backing this {@code Cipher}. + * + * @hide + */ + public CipherSpi getCurrentSpi() { + if (specifiedSpi != null) { + return specifiedSpi; + } + + synchronized (initLock) { + return spiImpl; + } + } + + /** * Try all combinations of mode strings: * * <pre> diff --git a/luni/src/main/java/javax/crypto/KeyAgreement.java b/luni/src/main/java/javax/crypto/KeyAgreement.java index d27aa2e..c804273 100644 --- a/luni/src/main/java/javax/crypto/KeyAgreement.java +++ b/luni/src/main/java/javax/crypto/KeyAgreement.java @@ -260,6 +260,18 @@ public class KeyAgreement { } /** + * Returns the {@code KeyAgreementSpi} backing this {@code KeyAgreement} or {@code null} if no + * {@code KeyAgreementSpi} is backing this {@code KeyAgreement}. + * + * @hide + */ + public KeyAgreementSpi getCurrentSpi() { + synchronized (initLock) { + return spiImpl; + } + } + + /** * Initializes this {@code KeyAgreement} with the specified key. * * @param key the key to initialize this key agreement. diff --git a/luni/src/main/java/javax/crypto/Mac.java b/luni/src/main/java/javax/crypto/Mac.java index 536f0c5..5774eb2 100644 --- a/luni/src/main/java/javax/crypto/Mac.java +++ b/luni/src/main/java/javax/crypto/Mac.java @@ -274,6 +274,18 @@ public class Mac implements Cloneable { } /** + * Returns the {@code MacSpi} backing this {@code Mac} or {@code null} if no {@code MacSpi} is + * backing this {@code Mac}. + * + * @hide + */ + public MacSpi getCurrentSpi() { + synchronized (initLock) { + return spiImpl; + } + } + + /** * Returns the length of this MAC (in bytes). * * @return the length of this MAC (in bytes). |