|
For the latest news and information visit The GNU Crypto project |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gnu.crypto.sig.dss.DSSKeyPairRawCodec
An object that implements the IKeyPairCodec
operations
for the Raw format to use with DSS keypairs.
Fields inherited from interface gnu.crypto.sig.IKeyPairCodec |
RAW_FORMAT |
Constructor Summary | |
DSSKeyPairRawCodec()
|
Method Summary | |
java.security.PrivateKey |
decodePrivateKey(byte[] k)
Decodes an instance of an external private key into its native Java representation. |
java.security.PublicKey |
decodePublicKey(byte[] k)
Decodes an instance of an external public key into its native Java representation. |
byte[] |
encodePrivateKey(java.security.PrivateKey key)
Returns the encoded form of the designated DSS (Digital Signature Standard) private key according to the Raw format supported by this library. |
byte[] |
encodePublicKey(java.security.PublicKey key)
Returns the encoded form of the designated DSS (Digital Signature Standard) public key according to the Raw format supported by this library. |
int |
getFormatID()
Returns the unique identifier (within this library) of the format used to externalise public and private keys. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public DSSKeyPairRawCodec()
Method Detail |
public int getFormatID()
IKeyPairCodec
getFormatID
in interface IKeyPairCodec
gnu.crypto.sig.IKeyPairCodec
public byte[] encodePublicKey(java.security.PublicKey key)
The Raw format for a DSA public key, in this implementation, is a byte sequence consisting of the following:
p
in internet order,BigInteger
obtained
by invoking the toByteArray()
method on the DSA parameter
p
,q
,BigInteger
obtained
by invoking the toByteArray()
method on the DSA parameter
q
,g
,BigInteger
obtained
by invoking the toByteArray()
method on the DSA parameter
g
,y
,BigInteger
obtained
by invoking the toByteArray()
method on the DSA parameter
y
,encodePublicKey
in interface IKeyPairCodec
key
- the key to encode.java.lang.IllegalArgumentException
- if the designated key is not a DSS
(Digital Signature Standard) one.public java.security.PublicKey decodePublicKey(byte[] k)
IKeyPairCodec
decodePublicKey
in interface IKeyPairCodec
gnu.crypto.sig.IKeyPairCodec
input
- the source of the externalised key to decode.java.lang.IllegalArgumentException
- if the designated input does not
contain a known representation of a public key for the format supported by
the concrete codec.public byte[] encodePrivateKey(java.security.PrivateKey key)
The Raw format for a DSA private key, in this implementation, is a byte sequence consisting of the following:
p
in internet order,BigInteger
obtained
by invoking the toByteArray()
method on the DSA parameter
p
,q
,BigInteger
obtained
by invoking the toByteArray()
method on the DSA parameter
q
,g
,BigInteger
obtained
by invoking the toByteArray()
method on the DSA parameter
g
,x
,BigInteger
obtained
by invoking the toByteArray()
method on the DSA parameter
x
,encodePrivateKey
in interface IKeyPairCodec
key
- the key to encode.public java.security.PrivateKey decodePrivateKey(byte[] k)
IKeyPairCodec
decodePrivateKey
in interface IKeyPairCodec
gnu.crypto.sig.IKeyPairCodec
input
- the source of the externalised key to decode.java.lang.IllegalArgumentException
- if the designated input does not
contain a known representation of a private key for the format supported
by the concrete codec.
|
For the latest news and information visit The GNU Crypto project |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |