| java.lang.Object com.sun.midp.crypto.Signature com.sun.midp.crypto.RsaShaSig
RsaShaSig | final public class RsaShaSig extends Signature (Code) | | Implements RSA SHA1 Signatures.
|
Constructor Summary | |
public | RsaShaSig() Constructs an RSA signature object that uses SHA1 as
message digest algorithm. |
Method Summary | |
public String | getAlgorithm() Gets the signature algorithm. | public int | getLength() Gets the byte-length of the signature. | public void | initSign(PrivateKey theKey) Initializes the RSASig object with the appropriate
Key for signature creation. | public void | initVerify(PublicKey theKey) Initializes the RSASig object with the appropriate
Key for signature verification. | public int | sign(byte[] sigBuf, int sigOff, int sigLen) Generates the signature of all/last input data. | public void | update(byte[] inBuf, int inOff, int inLen) Accumulates a signature of the input data. | public boolean | verify(byte[] sigBuf, int sigOff, int sigLen) Verifies the signature of all/last input data against the passed
in signature. |
RsaShaSig | public RsaShaSig()(Code) | | Constructs an RSA signature object that uses SHA1 as
message digest algorithm.
exception: RuntimeException - if SHA-1 is not available |
getAlgorithm | public String getAlgorithm()(Code) | | Gets the signature algorithm.
the algorithmimplemented by this signature object |
getLength | public int getLength()(Code) | | Gets the byte-length of the signature.
the byte-length of the signature produced by this object |
initSign | public void initSign(PrivateKey theKey) throws InvalidKeyException(Code) | | Initializes the RSASig object with the appropriate
Key for signature creation.
Parameters: theKey - the key object to use for signing exception: InvalidKeyException - if the key type is inconsistent with the mode or signature implementation. |
initVerify | public void initVerify(PublicKey theKey) throws InvalidKeyException(Code) | | Initializes the RSASig object with the appropriate
Key for signature verification.
Parameters: theKey - the key object to use for verification exception: InvalidKeyException - if the key type is inconsistent with the mode or signature implementation. |
sign | public int sign(byte[] sigBuf, int sigOff, int sigLen) throws SignatureException(Code) | | Generates the signature of all/last input data. A call to this
method also resets this signature object to the state it was in
when previously initialized via a call to init(). That is, the
object is reset and available to sign another message.
Parameters: sigBuf - the output buffer to store signature data Parameters: sigOff - starting offset within the output buffer at whichto begin signature data Parameters: sigLen - max length the signature can be number of bytes of signature output in sigBuf exception: SignatureException - if the signature algorithm does not pad the message and themessage is not block aligned |
update | public void update(byte[] inBuf, int inOff, int inLen) throws SignatureException(Code) | | Accumulates a signature of the input data. When this method is used,
temporary storage of intermediate results is required. This method
should only be used if all the input data required for the signature
is not available in one byte array. The sign() or verify() method is
recommended whenever possible.
Parameters: inBuf - the input buffer of data to be signed Parameters: inOff - starting offset within the input buffer for data tobe signed Parameters: inLen - the byte length of data to be signed exception: SignatureException - if the signature algorithm does not pad the message and themessage is not block aligned See Also: RsaShaSig.verify(byte[],int,int,byte[],int,short) |
verify | public boolean verify(byte[] sigBuf, int sigOff, int sigLen) throws SignatureException(Code) | | Verifies the signature of all/last input data against the passed
in signature. A call to this method also resets this signature
object to the state it was in when previously initialized via a
call to init(). That is, the object is reset and available to
verify another message.
Parameters: sigBuf - the input buffer containing signature data Parameters: sigOff - starting offset within the sigBuf where signaturedata begins Parameters: sigLen - byte length of signature data true if signature verifies, false otherwise exception: SignatureException - if the signature algorithm does not pad the message and themessage is not block aligned |
|
|