The IKeyPairCodec Interface
A key pair codec is used to externalize and de-externalize the key pairs
used in GNU Crypto. There is no factory class, but rather the
implementations have public, zero-argument constructors. The available
codecs are:
gnu.crypto.key.dh.DHKeyPairRawCodec
, for encoding and decoding
Diffie-Hellman key pairs.
gnu.crypto.key.dss.DSSKeyPairRawCodec
, for encoding and decoding
DSS key pairs.
gnu.crypto.key.rsa.RSAKeyPairRawCodec
, for encoding and decoding
RSA key pairs.
gnu.crypto.key.srp6.SRPKeyPairRawCodec
, for encoding and decoding
SRP key pairs.
Constant identifying the "raw" format used by GNU Crypto.
|
java.security.PrivateKey decodePrivateKey (byte[] encoded)
|
Function |
Decodes a private key from its external representation, returning it
as an appropriate instance of java.security.PrivateKey . This
function will throw a java.lang.IllegalArgumentException if the
encoded bytes cannot be decoded or are incorrect.
|
java.security.PublicKey decodePublicKey (byte[] encoded)
|
Function |
Decodes a public key from its external representation, returning it
as an appropriate instance of java.security.PublicKey . This
function will throw a java.lang.IllegalArgumentException if the
encoded bytes cannot be decoded or are incorrect.
|
byte [] encodePrivateKey (java.security.PrivateKey key)
|
Function |
Encodes a private key to its external representation, returning the
encoded bytes. This function will throw a
java.lang.IllegalArgumentException if the key cannot be encoded
by this instance.
|
byte [] encodePublicKey (java.security.PublicKey key)
|
Function |
Encodes a public key to its external representation, returning the
encoded bytes. This function will throw a
java.lang.IllegalArgumentException if the key cannot be encoded
by this instance.
|
int getFormatID ()
|
Function |
Returns the format identifier of this codec, such as RAW_FORMAT .
|