diff options
Diffstat (limited to 'gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java')
| -rw-r--r-- | gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java b/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java index a7f65b610..0b9809032 100644 --- a/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java +++ b/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java @@ -45,6 +45,7 @@ import java.security.InvalidParameterException; import java.security.PrivateKey; import java.security.PublicKey; import java.util.ArrayList; +import java.util.logging.Logger; import gnu.java.security.OID; import gnu.java.security.Registry; @@ -62,6 +63,7 @@ import gnu.java.security.util.DerUtil; public class RSAKeyPairPKCS8Codec implements IKeyPairCodec { + private static final Logger log = Logger.getLogger(RSAKeyPairPKCS8Codec.class.getName()); private static final OID RSA_ALG_OID = new OID(Registry.RSA_OID_STRING); // implicit 0-arguments constructor @@ -120,6 +122,8 @@ public class RSAKeyPairPKCS8Codec */ public byte[] encodePrivateKey(PrivateKey key) { + log.entering(this.getClass().getName(), "encodePrivateKey()", key); + if (! (key instanceof GnuRSAPrivateKey)) throw new InvalidParameterException("Wrong key type"); @@ -187,6 +191,7 @@ public class RSAKeyPairPKCS8Codec throw y; } + log.exiting(this.getClass().getName(), "encodePrivateKey()", result); return result; } @@ -208,6 +213,8 @@ public class RSAKeyPairPKCS8Codec */ public PrivateKey decodePrivateKey(byte[] input) { + log.entering(this.getClass().getName(), "decodePrivateKey()", input); + if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); @@ -278,7 +285,9 @@ public class RSAKeyPairPKCS8Codec throw y; } - return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, d, p, q, - dP, dQ, qInv); + PrivateKey result = new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID, n, e, + d, p, q, dP, dQ, qInv); + log.exiting(this.getClass().getName(), "decodePrivateKey()", result); + return result; } } |
