|
XCMS Toolkit | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cms.crypto.PublicKeyAdapter
public class PublicKeyAdapter
Implements the PublicKey public interface and uses
the Adapter design pattern to provide a meachanism to manipulate
Java class PublicKey.
| Field Summary |
|---|
| Fields inherited from interface java.security.PublicKey |
|---|
serialVersionUID |
| Constructor Summary | |
|---|---|
PublicKeyAdapter(java.security.PublicKey key)
Constructor for PublicKeyAdapter with public key parameter. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object object)
Returns boolean true or false
indicating whether or not two public keys are the same. |
java.lang.String |
getAlgorithm()
Returns a public key algorithm. |
byte[] |
getEncoded()
Returns an encoded public key. |
java.lang.String |
getFormat()
Returns a public key format. |
byte[] |
getMessageDigest()
Gets a SHA-1 message digest of a value of ASN.1 type SubjectPublicKeyInfo for an ECDSA public key. |
byte[] |
getMessageDigest(DigestAlgorithmIdentifier algorithmId)
Gets the message digest of a value of ASN.1 type SubjectPublicKeyInfo for an ECDSA public key
using the hash algorithm specified by the provided
digest algorithm identifier. |
byte[] |
getSubjectPublicKeyInfo()
Gets the public key bits from a value of ASN.1 type SubjectPublicKeyInfo. |
int |
hashCode()
Returns the message digest (hash) of a public key ( SubjectPublicKeyInfo). |
java.lang.String |
toString()
Returns a braces delimted string. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PublicKeyAdapter(java.security.PublicKey key)
PublicKeyAdapter with public key parameter.
key - the public key component of a public-private key pair| Method Detail |
|---|
public java.lang.String getAlgorithm()
getAlgorithm in interface java.security.Keypublic java.lang.String getFormat()
getFormat in interface java.security.Keypublic byte[] getEncoded()
getEncoded in interface java.security.Keypublic boolean equals(java.lang.Object object)
boolean true or false
indicating whether or not two public keys are the same.
equals in class java.lang.Objectpublic int hashCode()
SubjectPublicKeyInfo).
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public byte[] getSubjectPublicKeyInfo()
throws DecodingException,
java.io.IOException
SubjectPublicKeyInfo.
Shades of Brian Korver (aka Luke Bytewalker)! We're byte walking the following ASN.1 value to get the encoded ECPublicKey bits.
For ECMQV, the OriginatorPublicKey.algorithm.parameters field always contains an OpenType that contains an OBJECT IDENTIFIER that indicates a named elliptic curve.
We are assuming here that all tags are one byte in length.
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm PublicKeyAlgorithmIdentifier,
publicKey BIT STRING
}
DecodingException
java.io.IOException
public byte[] getMessageDigest()
throws DecodingException,
java.io.IOException,
java.security.NoSuchAlgorithmException
SubjectPublicKeyInfo for an ECDSA public key.
DecodingException
java.io.IOException
java.security.NoSuchAlgorithmException
public byte[] getMessageDigest(DigestAlgorithmIdentifier algorithmId)
throws DecodingException,
java.io.IOException,
java.security.NoSuchAlgorithmException
SubjectPublicKeyInfo for an ECDSA public key
using the hash algorithm specified by the provided
digest algorithm identifier.
algorithmId - a message digest algorithm identifier
DecodingException
java.io.IOException
java.security.NoSuchAlgorithmException
|
XCMS Toolkit | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||