public final class PK11Signature extends SignatureSpi implements java.lang.AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected Algorithm |
algorithm |
protected Algorithm |
digestAlgorithm |
protected org.mozilla.jss.pkcs11.PK11Key |
key |
protected boolean |
raw |
protected java.io.ByteArrayOutputStream |
rawInput |
protected org.mozilla.jss.pkcs11.SigContextProxy |
sigContext |
static int |
SIGN |
protected int |
state |
protected PK11Token |
token |
protected TokenProxy |
tokenProxy |
static int |
UNINITIALIZED |
static int |
VERIFY |
| Constructor and Description |
|---|
PK11Signature(PK11Token token,
SignatureAlgorithm algorithm) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
engineInitSign(PrivateKey privateKey) |
void |
engineInitSign(PrivateKey privateKey,
java.security.SecureRandom random)
This is just here for JCA compliance, we don't take randoms this way.
|
void |
engineInitVerify(java.security.PublicKey publicKey) |
protected static boolean |
engineRawVerifyNative(PK11Token token,
java.security.PublicKey key,
byte[] hash,
byte[] signature)
Performs raw verification of the signature of a hash using the
given public key, on the given token.
|
void |
engineSetParameter(java.security.spec.AlgorithmParameterSpec params) |
byte[] |
engineSign() |
int |
engineSign(byte[] outbuf,
int offset,
int len) |
void |
engineUpdate(byte b) |
void |
engineUpdate(byte[] b,
int off,
int len) |
protected void |
engineUpdateNative(byte[] b,
int off,
int len) |
boolean |
engineVerify(byte[] sigBytes) |
protected boolean |
engineVerifyNative(byte[] sigBytes) |
void |
finalize() |
protected void |
initSigContext()
Creates a signing context, initializes it,
and sets the sigContext field.
|
protected void |
initVfyContext() |
protected PK11Token token
protected TokenProxy tokenProxy
protected Algorithm algorithm
protected Algorithm digestAlgorithm
protected org.mozilla.jss.pkcs11.PK11Key key
protected int state
protected org.mozilla.jss.pkcs11.SigContextProxy sigContext
protected boolean raw
protected java.io.ByteArrayOutputStream rawInput
public static final int UNINITIALIZED
public static final int SIGN
public static final int VERIFY
public PK11Signature(PK11Token token, SignatureAlgorithm algorithm) throws java.security.NoSuchAlgorithmException, TokenException
java.security.NoSuchAlgorithmExceptionTokenExceptionpublic void engineInitSign(PrivateKey privateKey) throws java.security.InvalidKeyException, TokenException
engineInitSign in class SignatureSpijava.security.InvalidKeyExceptionTokenExceptionpublic void engineInitSign(PrivateKey privateKey, java.security.SecureRandom random) throws java.security.InvalidKeyException, TokenException
engineInitSign in class SignatureSpijava.security.InvalidKeyExceptionTokenExceptionprotected void initSigContext()
throws TokenException
TokenExceptionpublic void engineInitVerify(java.security.PublicKey publicKey)
throws java.security.InvalidKeyException,
TokenException
engineInitVerify in class SignatureSpijava.security.InvalidKeyExceptionTokenExceptionprotected void initVfyContext()
throws TokenException
TokenExceptionpublic void engineUpdate(byte b)
throws java.security.SignatureException,
TokenException
engineUpdate in class SignatureSpijava.security.SignatureExceptionTokenExceptionpublic void engineUpdate(byte[] b,
int off,
int len)
throws java.security.SignatureException,
TokenException
engineUpdate in class SignatureSpijava.security.SignatureExceptionTokenExceptionprotected void engineUpdateNative(byte[] b,
int off,
int len)
throws TokenException
TokenExceptionpublic byte[] engineSign()
throws java.security.SignatureException,
TokenException
engineSign in class SignatureSpijava.security.SignatureExceptionTokenExceptionpublic int engineSign(byte[] outbuf,
int offset,
int len)
throws java.security.SignatureException,
TokenException
engineSign in class SignatureSpijava.security.SignatureExceptionTokenExceptionpublic boolean engineVerify(byte[] sigBytes)
throws java.security.SignatureException,
TokenException
engineVerify in class SignatureSpijava.security.SignatureExceptionTokenExceptionprotected static boolean engineRawVerifyNative(PK11Token token, java.security.PublicKey key, byte[] hash, byte[] signature) throws java.security.SignatureException, TokenException
java.security.SignatureExceptionTokenExceptionprotected boolean engineVerifyNative(byte[] sigBytes)
throws java.security.SignatureException,
TokenException
java.security.SignatureExceptionTokenExceptionpublic void engineSetParameter(java.security.spec.AlgorithmParameterSpec params)
throws java.security.InvalidAlgorithmParameterException,
TokenException
engineSetParameter in class SignatureSpijava.security.InvalidAlgorithmParameterExceptionTokenExceptionpublic void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exception