|
Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10668-03 |
||||||||
| 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
public final class 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 |
rsaKeyOIDThe ASN.1 Object Identifier rsaEncryption, as defined in PKCS #1 to identify the RSA encryption algorithm. |
static ASN1ObjectID |
rsaMD2SigOIDThe ASN.1 Object Identifier md2WithRSAEncryption, defined in PKCS#1. |
static ASN1ObjectID |
rsaMD5SigOIDThe ASN.1 Object Identifier md5WithRSAEncryption, defined in PKCS#1. |
static ASN1ObjectID |
rsaSHA256SigOIDThe ASN.1 Object Identifier sha256WithRSAEncryption, defined in PKCS#1. |
static ASN1ObjectID |
rsaSHASigOIDThe ASN.1 Object Identifier sha_1WithRSAEncryption, defined in PKCS#1. |
static ASN1ObjectID |
rsaSHASigOldOIDThe old OIW ASN.1 Object Identifier SHA1 With RSAEncryption. |
| 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 k, byte[] sigBytes, byte[] doc)Creates a new instance ready to verify a signature using the given public key, signature bytes and original document. |
|
| Method Summary | |
|---|---|
java.lang.String |
algName()Returns the name of the signing algorithm. |
AlgorithmIdentifier |
getAlgID()Gets the algorithm identifier of this Signature object. |
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)Sets the signature algorithm identifier to use, |
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 |
|---|
getDocument, getInstance, getInstance, getInstance, getSigBytes, 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
sha_1WithRSAEncryption, defined in PKCS#1.public static final ASN1ObjectID rsaSHA256SigOID
sha256WithRSAEncryption, defined in PKCS#1.public static final ASN1ObjectID rsaSHASigOldOID
| Constructor Detail |
|---|
public RSAMDSignature()
RSAMDSignature with the default digest algorithm (MD5).public RSAMDSignature(RSAPublicKey pk)
RSAMDSignature with the default digest algorithm (MD5), and sets the verification key.
public RSAMDSignature(RSAPublicKey pk,
AlgorithmIdentifier messageDigestAlgID)
java.lang.IllegalArgumentException - If messageDigestAlgID is not recognized.public 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 reason
public RSAMDSignature(RSAPrivateKey priv,
AlgorithmIdentifier messageDigestAlgID,
byte[] doc)
throws SignatureException
sign() is called automatically.)
SignatureException - if the signature could not be generated for some reason
public RSAMDSignature(RSAPublicKey k,
byte[] sigBytes,
byte[] doc)
| Method Detail |
|---|
public void setAlgID(AlgorithmIdentifier algID)
throws AlgorithmIdentifierException
SignaturesetAlgID in class SignaturealgID - The AlgorithmIdentifier to use to perform signature and verification.AlgorithmIdentifierExceptionpublic AlgorithmIdentifier getAlgID()
SignaturegetAlgID in class Signaturepublic AlgorithmIdentifier getDigestEncryptionAlgID()
SignaturegetDigestEncryptionAlgID in class Signaturepublic void setMessageDigestAlgID(AlgorithmIdentifier messageDigestAlgID)
public AlgorithmIdentifier getMessageDigestAlgID()
public java.lang.String algName()
algName in class Signature
public void setPublicKey(PublicKey publicKey)
throws InvalidKeyException
RSAPublicKey.setPublicKey in class SignaturepublicKey - the public keyInvalidKeyException
public void setPrivateKey(PrivateKey privateKey)
throws InvalidKeyException
RSAPrivateKey.setPrivateKey in class SignatureprivateKey - the private keyInvalidKeyExceptionpublic void setHash(byte[] hash)
null.setHash in class Signaturehash - the DER encoding for a PKCS #1 DigestInfo element.Signature.setDocument(byte[])public void setRandomBitsSource(RandomBitsSource rbs)
setRandomBitsSource in class Signaturerbs - the random bits source to be used to generate signatures
public boolean verify()
throws AuthenticationException
setSigBytes, setPublicKey and setDocument, or an appropriate constructor.verify in class Signaturetrue 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 SignatureSignatureException - if the signature could not be generated for some reasonSignature.setDocument(byte[]), setPrivateKey(oracle.security.crypto.core.PrivateKey), Signature.getSigBytes()
|
Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10668-03 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||