|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mozilla.jss.crypto.Signature
A class for producing and verifying digital signatures.
Instances of this class can be obtain from CryptoToken
s.
CryptoToken.getSignatureContext(org.mozilla.jss.crypto.SignatureAlgorithm)
Method Summary | |
java.lang.String |
getAlgorithm()
Returns the name of the algorithm to be used for signing. |
SignatureAlgorithm |
getAlgorithmID()
Returns the algorithm to be used for signing. |
java.security.Provider |
getProvider()
This is not supported yet. |
void |
initSign(PrivateKey privateKey)
Initialize the signature context for signing. |
void |
initVerify(java.security.PublicKey publicKey)
Initialize the signature context for verifying. |
void |
setParameter(java.security.spec.AlgorithmParameterSpec params)
Set parameters for the signing algorithm. |
byte[] |
sign()
Finish a signing operation and return the signature. |
int |
sign(byte[] outbuf,
int offset,
int len)
Finish a signing operation and store the signature in the provided buffer. |
void |
update(byte b)
Provide more data for a signature or verification operation. |
void |
update(byte[] data)
Provide more data for a signature or verification operation. |
void |
update(byte[] data,
int off,
int len)
Provide more data for a signature or verification operation. |
boolean |
verify(byte[] signature)
Finish a verification operation. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public java.security.Provider getProvider()
public void initSign(PrivateKey privateKey) throws java.security.InvalidKeyException, TokenException
privateKey
- The private key with which to sign.public void initVerify(java.security.PublicKey publicKey) throws java.security.InvalidKeyException, TokenException
publicKey
- The public key with which to verify the signature.public void setParameter(java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidAlgorithmParameterException, TokenException
params
- Parameters for the signing algorithm.public byte[] sign() throws java.security.SignatureException, TokenException
public int sign(byte[] outbuf, int offset, int len) throws java.security.SignatureException, TokenException
outbuf
- Buffer to hold the signatureoffset
- Offset in buffer at which to store signature.len
- Number of bytes of buffer available for signature.public boolean verify(byte[] signature) throws java.security.SignatureException, TokenException
signature
- The signature to be verified.public void update(byte b) throws java.security.SignatureException, TokenException
b
- A byte to be signed or verified.public void update(byte[] data) throws java.security.SignatureException, TokenException
data
- An array of bytes to be signed or verified.public void update(byte[] data, int off, int len) throws java.security.SignatureException, TokenException
data
- An array of bytes, some of which will be signed or verified.off
- The beginning offset of the bytes to be signed/verified.len
- The number of bytes to be signed/verified.public java.lang.String getAlgorithm()
public SignatureAlgorithm getAlgorithmID()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |