|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neuclear.commons.crypto.signers.DefaultSigner
public final class DefaultSigner
Easy to use preconfigured Signer that uses the standard default JCE KeyStore User: pelleb Date: Oct 29, 2003 Time: 3:22:17 PM
| Field Summary |
|---|
| Fields inherited from interface org.neuclear.commons.crypto.signers.Signer |
|---|
KEY_DSA, KEY_NONE, KEY_OTHER, KEY_RSA |
| Constructor Summary | |
|---|---|
DefaultSigner()
|
|
DefaultSigner(InteractiveAgent agent)
|
|
| Method Summary | |
|---|---|
boolean |
canSignFor(java.lang.String name)
Returns true if the Signer contains a signer for the given name |
void |
createKeyPair(java.lang.String alias,
char[] passphrase)
|
java.security.PublicKey |
generateKey()
Creates a new KeyPair, stores the PrivateKey using the base32 sha1 of the public key as it's alias and returns the PublicKey. |
java.security.PublicKey |
generateKey(java.lang.String alias)
Creates a new KeyPair, stores the PrivateKey using the given alias and returns the PublicKey. |
InteractiveAgent |
getAgent()
|
int |
getKeyType(java.lang.String name)
Checks the key type of the given alias |
java.security.PublicKey |
getPublicKey(java.lang.String name)
|
java.util.Iterator |
iterator()
|
void |
save()
|
void |
save(boolean force)
|
byte[] |
sign(byte[] data,
SetPublicKeyCallBack callback)
|
byte[] |
sign(java.lang.String name,
byte[] data)
Signs the data with the privatekey of the given name |
byte[] |
sign(java.lang.String name,
byte[] data,
boolean incorrect)
|
byte[] |
sign(java.lang.String name,
char[] pass,
byte[] data,
SetPublicKeyCallBack callback)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultSigner(InteractiveAgent agent)
throws UserCancellationException
UserCancellationException
public DefaultSigner()
throws UserCancellationException
UserCancellationException| Method Detail |
|---|
public final byte[] sign(java.lang.String name,
byte[] data)
throws NonExistingSignerException,
UserCancellationException
Signer
sign in interface Signername - Alias of private key to be used within KeyStoredata - Data to be signed
NonExistingSignerException
UserCancellationException
public final byte[] sign(java.lang.String name,
byte[] data,
boolean incorrect)
throws UserCancellationException,
NonExistingSignerException
UserCancellationException
NonExistingSignerExceptionpublic final boolean canSignFor(java.lang.String name)
Signer
canSignFor in interface Signerpublic final int getKeyType(java.lang.String name)
Signer
getKeyType in interface Signer
public final java.security.PublicKey generateKey(java.lang.String alias)
throws UserCancellationException
Signer
generateKey in interface SignerUserCancellationException
public java.security.PublicKey generateKey()
throws UserCancellationException
Signer
generateKey in interface SignerUserCancellationException
public final java.security.PublicKey getPublicKey(java.lang.String name)
throws NonExistingSignerException
getPublicKey in interface PublicKeySourceNonExistingSignerException
public byte[] sign(byte[] data,
SetPublicKeyCallBack callback)
throws UserCancellationException
sign in interface BrowsableSignerUserCancellationException
public byte[] sign(java.lang.String name,
char[] pass,
byte[] data,
SetPublicKeyCallBack callback)
throws InvalidPassphraseException
sign in interface BrowsableSignerInvalidPassphraseException
public void createKeyPair(java.lang.String alias,
char[] passphrase)
throws CryptoException
createKeyPair in interface BrowsableSignerCryptoExceptionpublic InteractiveAgent getAgent()
public void save()
save in interface Signer
public void save(boolean force)
throws java.io.IOException,
UserCancellationException
java.io.IOException
UserCancellationException
public java.util.Iterator iterator()
throws java.security.KeyStoreException
iterator in interface BrowsableSignerjava.security.KeyStoreException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||