|
Oracle Security Developer Tools Crypto Java API Reference 10g (10.1.4.0.1) B28171-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.core.Signature
oracle.security.crypto.core.RSAMDSignature
Signatures using RSA encryption in conjunction with the MD2, MD5, or SHA message digest algorithm. The signature bytes are encoded in PKCS #1 format.
Field Summary | |
static ASN1ObjectID |
rsaKeyOID The ASN.1 Object Identifier rsaEncryption , as defined in PKCS #1 to identify the RSA encryption algorithm. |
static ASN1ObjectID |
rsaMD2SigOID The ASN.1 Object Identifier md2WithRSAEncryption , defined in PKCS#1. |
static ASN1ObjectID |
rsaMD5SigOID The ASN.1 Object Identifier md5WithRSAEncryption , defined in PKCS#1. |
static ASN1ObjectID |
rsaSHASigOID |
static ASN1ObjectID |
rsaSHASigOldOID |
Fields inherited from class oracle.security.crypto.core.Signature |
document, signatureBytes |
Constructor Summary | |
RSAMDSignature() Creates a new RSAMDSignature with the default digest algorithm (MD5). |
|
RSAMDSignature(RSAPrivateKey priv) Creates a new RSAMDSignature with the default digest algorithm (MD5), and sets the signature key. |
|
RSAMDSignature(RSAPrivateKey priv, AlgorithmIdentifier messageDigestAlgID) |
|
RSAMDSignature(RSAPrivateKey priv, AlgorithmIdentifier messageDigestAlgID, byte[] doc) Creates a new signature object with the given private key, message digest algorithm, and document, and generates the signature bytes. |
|
RSAMDSignature(RSAPrivateKey priv, byte[] doc) Creates a new signature object with the given private key and document, and generates the signature bytes. |
|
RSAMDSignature(RSAPublicKey pk) Creates a new RSAMDSignature with the default digest algorithm (MD5), and sets the verification key. |
|
RSAMDSignature(RSAPublicKey pk, AlgorithmIdentifier messageDigestAlgID) Create a signature object for verifying a signature made with the given public key. |
|
RSAMDSignature(RSAPublicKey pk, ASN1ObjectID sigAlgOID) Deprecated. Use RSAMDSignature(RSAPublicKey, AlgorithmIdentifier) |
|
RSAMDSignature(RSAPublicKey k, byte[] sigBytes, byte[] doc) Creates a new instance ready to verify a signature using the given public key, signature bytes and original document. |
|
RSAMDSignature(RSAPublicKey pk, RSAPrivateKey priv) Deprecated. Use RSAMDSignature(RSAPrivateKey) and setPublicKey(PublicKey) |
|
RSAMDSignature(RSAPublicKey pk, RSAPrivateKey priv, byte[] doc) Deprecated. Use RSAMDSignature(RSAPrivateKey, byte[]) and setPublicKey(PublicKey) |
Method Summary | |
java.lang.String |
algName() Returns the name of the signing algorithm. |
ASN1ObjectID |
algorithmOID() Deprecated. Instead, use getAlgID().getOID() . |
AlgorithmIdentifier |
getAlgID() |
AlgorithmIdentifier |
getDigestEncryptionAlgID() Returns the algorithm identifier of the message digest encryption for this signature. |
AlgorithmIdentifier |
getMessageDigestAlgID() Gets the message digest algorithm for this RSA signature . |
void |
setAlgID(AlgorithmIdentifier algID) |
void |
setHash(byte[] hash) Sets the document digest to be used in the signature calculation, bypassing the digesting step. |
void |
setMessageDigestAlgID(AlgorithmIdentifier messageDigestAlgID) Sets the message digest Algorithm for this RSA signature . |
void |
setPrivateKey(PrivateKey privateKey) Sets the private key to be used for signing. |
void |
setPublicKey(PublicKey publicKey) Sets the public key to be used for verification. |
void |
setRandomBitsSource(RandomBitsSource rbs) Sets the random bits source used to generate signatures. |
byte[] |
sign() Signs the document. |
boolean |
verify() Verify that the signature matches the document. |
Methods inherited from class oracle.security.crypto.core.Signature |
getBytes, getDocument, getInstance, getInstance, getInstance, getSigBytes, setBytes, setDocument, setSigBytes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final ASN1ObjectID rsaKeyOID
rsaEncryption
, as defined in PKCS #1 to identify the RSA encryption algorithm.public static final ASN1ObjectID rsaMD2SigOID
md2WithRSAEncryption
, defined in PKCS#1.public static final ASN1ObjectID rsaMD5SigOID
md5WithRSAEncryption
, defined in PKCS#1.public static final ASN1ObjectID rsaSHASigOID
public static final ASN1ObjectID rsaSHASigOldOID
Constructor Detail |
public RSAMDSignature()
RSAMDSignature
with the default digest algorithm (MD5).public RSAMDSignature(RSAPublicKey pk, RSAPrivateKey priv)
RSAMDSignature(RSAPrivateKey)
and setPublicKey(PublicKey)
public RSAMDSignature(RSAPublicKey pk, RSAPrivateKey priv, byte[] doc) throws SignatureException
RSAMDSignature(RSAPrivateKey, byte[])
and setPublicKey(PublicKey)
public RSAMDSignature(RSAPublicKey pk)
RSAMDSignature
with the default digest algorithm (MD5), and sets the verification key.public RSAMDSignature(RSAPublicKey pk, ASN1ObjectID sigAlgOID)
RSAMDSignature(RSAPublicKey, AlgorithmIdentifier)
public RSAMDSignature(RSAPublicKey pk, AlgorithmIdentifier messageDigestAlgID)
java.lang.IllegalArgumentException
- if messageDigestAlgID is not recognizedpublic RSAMDSignature(RSAPrivateKey priv)
RSAMDSignature
with the default digest algorithm (MD5), and sets the signature key.public RSAMDSignature(RSAPrivateKey priv, AlgorithmIdentifier messageDigestAlgID)
public RSAMDSignature(RSAPrivateKey priv, byte[] doc) throws SignatureException
sign()
is called automatically.) The default digest algorithm is used (MD5).SignatureException
- if the signature could not be generated for some reasonpublic RSAMDSignature(RSAPrivateKey priv, AlgorithmIdentifier messageDigestAlgID, byte[] doc) throws SignatureException
sign()
is called automatically.)SignatureException
- if the signature could not be generated for some reasonpublic RSAMDSignature(RSAPublicKey k, byte[] sigBytes, byte[] doc)
Method Detail |
public void setAlgID(AlgorithmIdentifier algID) throws AlgorithmIdentifierException
setAlgID
in class Signature
AlgorithmIdentifierException
public AlgorithmIdentifier getAlgID()
getAlgID
in class Signature
public AlgorithmIdentifier getDigestEncryptionAlgID()
Signature
getDigestEncryptionAlgID
in class Signature
public void setMessageDigestAlgID(AlgorithmIdentifier messageDigestAlgID)
public AlgorithmIdentifier getMessageDigestAlgID()
public java.lang.String algName()
algName
in class Signature
public ASN1ObjectID algorithmOID()
getAlgID().getOID()
.public void setPublicKey(PublicKey publicKey) throws InvalidKeyException
RSAPublicKey
.setPublicKey
in class Signature
publicKey
- the public keyInvalidKeyException
public void setPrivateKey(PrivateKey privateKey) throws InvalidKeyException
RSAPrivateKey
.setPrivateKey
in class Signature
privateKey
- the private keyInvalidKeyException
public void setHash(byte[] hash)
null
.setHash
in class Signature
hash
- the DER encoding for a PKCS #1 DigestInfo element.Signature.setDocument(byte[])
public void setRandomBitsSource(RandomBitsSource rbs)
setRandomBitsSource
in class Signature
rbs
- the random bits source to be used to generate signaturespublic boolean verify() throws AuthenticationException
setSigBytes
, setPublicKey
and setDocument
, or an appropriate constructor.verify
in class Signature
true
if the signature is valid, and false
if it is invalidAuthenticationException
- if the verification could not be performed for some reasonSignature.setSigBytes(byte[])
, setPublicKey(oracle.security.crypto.core.PublicKey)
, Signature.setDocument(byte[])
public byte[] sign() throws SignatureException
getSigBytes
.
The document and private key must first have been specified via setDocument
and setPrivateKey
, or an appropriate constructor.
sign
in class Signature
SignatureException
- if the signature could not be generated for some reasonSignature.setDocument(byte[])
, setPrivateKey(oracle.security.crypto.core.PrivateKey)
, Signature.getSigBytes()
|
Oracle Security Developer Tools Crypto Java API Reference 10g (10.1.4.0.1) B28171-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |