|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bees.core.security.Signature
Signature is a thin veneer over the standard java.security.Signature class that uses bees.core.security classes.
Note: In order to prevent downloaded code from producing signatures for arbitrary data, the flow identifier is always added to the signature.
Field Summary | |
static Permission |
SIGN_PERMISSION
Permission to use this key for signing. |
static Permission |
VERIFY_PERMISSION
Permission to use this key for verification. |
Constructor Summary | |
Signature(java.lang.String algorithm)
Construct a Signature object that uses the given algorithm type. |
Method Summary | |
java.lang.String |
getAlgorithm()
|
java.lang.Object |
getParameter(java.lang.String param)
|
void |
initSign(PrivateKeySpec privateKey)
Initialize the signature object for signing. |
void |
initSign(PrivateKeySpec privateKey,
ProtocolSession ps)
Initialize the signature object for signing. |
void |
initSign(PrivateKeySpec privateKey,
java.security.SecureRandom random)
Initialize the signature object for signing. |
void |
initSign(PrivateKeySpec privateKey,
java.security.SecureRandom random,
ProtocolSession ps)
Initialize the signature object for signing. |
void |
initVerify(PublicKeySpec publicKey)
Initialize the signature object for verification. |
void |
initVerify(PublicKeySpec publicKey,
ProtocolSession ps)
Initialize the signature object for verification. |
void |
setParameter(java.security.spec.AlgorithmParameterSpec params)
|
void |
setParameter(java.lang.String param,
java.lang.Object value)
|
byte[] |
sign()
|
int |
sign(byte[] outbuf,
int offset,
int len)
|
java.lang.String |
toString()
|
void |
update(byte b)
|
void |
update(byte[] data)
|
void |
update(byte[] data,
int off,
int len)
|
boolean |
verify(byte[] signature)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Permission SIGN_PERMISSION
public static final Permission VERIFY_PERMISSION
Constructor Detail |
public Signature(java.lang.String algorithm) throws java.security.NoSuchAlgorithmException
algorithm
- The name of the algorithm to use when
signing/verifying.java.security.NoSuchAlgorithmException
- if the given algorithm is not
supported.Method Detail |
public void initVerify(PublicKeySpec publicKey, ProtocolSession ps) throws java.security.InvalidKeyException, java.security.SignatureException
publicKey
- The public key of the identity whose signature is going
to be verified.ps
- A ProtocolSession from the flow this signature was bound to or
null if this domain is an application.java.security.SignatureException
- if there was a problem adding the flow
identifier to the Signature.java.security.InvalidKeyException
- if the given key is invalid.public void initVerify(PublicKeySpec publicKey) throws java.security.InvalidKeyException
publicKey
- The public key of the identity whose signature is going
to be verified.java.security.InvalidKeyException
- if the given key is invalid.public void initSign(PrivateKeySpec privateKey) throws java.lang.SecurityException, java.security.InvalidKeyException
privateKey
- The private key of the identity whose signature is
going to be generated.java.lang.SecurityException
- if this domain is not an application.java.security.InvalidKeyException
- if the given key is invalid.public void initSign(PrivateKeySpec privateKey, java.security.SecureRandom random) throws java.lang.SecurityException, java.security.InvalidKeyException
privateKey
- The private key of the identity whose signature is
going to be generated.random
- The source of randomness for this signature.java.lang.SecurityException
- if this domain is not an application.java.security.InvalidKeyException
- if the given key is invalid.public void initSign(PrivateKeySpec privateKey, ProtocolSession ps) throws java.lang.SecurityException, java.security.InvalidKeyException, java.security.SignatureException
privateKey
- The private key of the identity whose signature is
going to be generated.ps
- A ProtocolSession from the flow this signature should be bound
to or null if this domain is an application.java.lang.SecurityException
- if this domain is not an application.java.security.InvalidKeyException
- if the given key is invalid.java.security.SignatureException
- if there was a problem updating the signature
with the flow identifier.public void initSign(PrivateKeySpec privateKey, java.security.SecureRandom random, ProtocolSession ps) throws java.lang.SecurityException, java.security.InvalidKeyException, java.security.SignatureException
privateKey
- The private key of the identity whose signature is
going to be generated.ps
- A ProtocolSession from the flow this signature should be bound
to or null if this domain is an application.random
- The source of randomness for this signature.java.lang.SecurityException
- if this domain is not an application.java.security.InvalidKeyException
- if the given key is invalid.java.security.SignatureException
- if there was a problem updating the signature
with the flow identifier.public byte[] sign() throws java.security.SignatureException
public int sign(byte[] outbuf, int offset, int len) throws java.security.SignatureException
public boolean verify(byte[] signature) throws java.security.SignatureException
public void update(byte b) throws java.security.SignatureException
public void update(byte[] data) throws java.security.SignatureException
public void update(byte[] data, int off, int len) throws java.security.SignatureException
public java.lang.String getAlgorithm()
public void setParameter(java.lang.String param, java.lang.Object value) throws java.security.InvalidParameterException
public void setParameter(java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidAlgorithmParameterException
public java.lang.Object getParameter(java.lang.String param) throws java.security.InvalidParameterException
public java.lang.String toString()
toString
in class java.lang.Object
|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |