gnu.crypto.key
Interface IKeyPairCodec
- DHKeyPairRawCodec, DSSKeyPairRawCodec, RSAKeyPairRawCodec, SRPKeyPairRawCodec
public interface IKeyPairCodec
The visible methods of an object that knows how to encode and decode
cryptographic asymmetric keypairs. Codecs are useful for (a) externalising
public and private keys for storage and on-the-wire transmission, as well as
(b) re-creating their internal Java representation from external sources.
Version:
static int | RAW_FORMAT - Constant identifying the Raw encoding format.
|
PrivateKey | decodePrivateKey(byte[] input) - Decodes an instance of an external private key into its native Java
representation.
|
PublicKey | decodePublicKey(byte[] input) - Decodes an instance of an external public key into its native Java
representation.
|
byte[] | encodePrivateKey(PrivateKey key) - Encodes an instance of a private key for storage or transmission purposes.
|
byte[] | encodePublicKey(PublicKey key) - Encodes an instance of a public key for storage or transmission purposes.
|
int | getFormatID() - Returns the unique identifier (within this library) of the format used
to externalise public and private keys.
|
RAW_FORMAT
public static final int RAW_FORMAT
Constant identifying the Raw encoding format.
- 1
decodePrivateKey
public PrivateKey decodePrivateKey(byte[] input)
Decodes an instance of an external private key into its native Java
representation.
input
- the source of the externalised key to decode.
- a concrete instance of a private key, reconstructed from the
designated input.
decodePublicKey
public PublicKey decodePublicKey(byte[] input)
Decodes an instance of an external public key into its native Java
representation.
input
- the source of the externalised key to decode.
- a concrete instance of a public key, reconstructed from the
designated input.
encodePrivateKey
public byte[] encodePrivateKey(PrivateKey key)
Encodes an instance of a private key for storage or transmission purposes.
key
- the non-null key to encode.
- a byte sequence representing the encoding of the designated key
according to the format supported by this codec.
encodePublicKey
public byte[] encodePublicKey(PublicKey key)
Encodes an instance of a public key for storage or transmission purposes.
key
- the non-null key to encode.
- a byte sequence representing the encoding of the designated key
according to the format supported by this codec.
getFormatID
public int getFormatID()
Returns the unique identifier (within this library) of the format used
to externalise public and private keys.
- the identifier of the format, the object supports.
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.