public class EcOriginatorPublicKey extends PublicKeyInfo
In CMS, when using an ECDH key agreement scheme, the following restrictions are imposed on the EC originator public key:
IMPORTANT: Before an EC originator public key can be used in an
cryptographic algorithm through the JCA/JCE it must be convert to standard
JCA/JCE EC public key representation using the
convertToECPublicKey(PrivateKey) API.
public_key_algorithm| Modifier and Type | Method and Description |
|---|---|
java.security.interfaces.ECPublicKey |
convertToECPublicKey(java.security.PrivateKey recipientPrivateKey)
Converts this public key to standard JCA/JCE representation by decoding
the public point contained in the originator EC public key using the EC
domain parameters from the recipient private key.
|
protected void |
decode(byte[] subjectPublicKey)
Decodes the public key value.
|
protected byte[] |
encode()
Encodes the public key value.
|
java.lang.String |
getAlgorithm()
Returns the algorithm of this key 'CMS_EC'.
|
createPublicKeyInfo, decode, equals, getEncoded, getFingerprint, getFormat, getPublicKey, getPublicKey, toASN1Object, toString, writeToprotected void decode(byte[] subjectPublicKey)
throws java.security.InvalidKeyException
Note: the EC public point is not decoded into ECPoint
representation. This cannot be done since the EC domain parameters are
not known at decode time.
decode in class PublicKeyInfosubjectPublicKey - the encoded public key value (the
SubjectPublicKeyInfo.subjectPublicKey component)java.security.InvalidKeyException - if an error occurs during decodingprotected byte[] encode()
encode in class PublicKeyInfopublic java.lang.String getAlgorithm()
Note: This public key is not intended for use in cryptographic operations through the JCA/JCE, so the algorithm is really not important.
getAlgorithm in interface java.security.KeygetAlgorithm in class PublicKeyInfopublic java.security.interfaces.ECPublicKey convertToECPublicKey(java.security.PrivateKey recipientPrivateKey)
throws java.security.InvalidKeyException
Following this operation, the resulting public key can be used in cryptographic operations through the JCA/JCE (i.e. key agreement).
recipientPrivateKey - the recipient private key that this originator public key is
being used withjava.security.InvalidKeyException - if an error occurs during the conversion process