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.NoSuchAlgorithmException
TokenException
public void engineInitSign(PrivateKey privateKey) throws java.security.InvalidKeyException, TokenException
engineInitSign
in class SignatureSpi
java.security.InvalidKeyException
TokenException
public void engineInitSign(PrivateKey privateKey, java.security.SecureRandom random) throws java.security.InvalidKeyException, TokenException
engineInitSign
in class SignatureSpi
java.security.InvalidKeyException
TokenException
protected void initSigContext() throws TokenException
TokenException
public void engineInitVerify(java.security.PublicKey publicKey) throws java.security.InvalidKeyException, TokenException
engineInitVerify
in class SignatureSpi
java.security.InvalidKeyException
TokenException
protected void initVfyContext() throws TokenException
TokenException
public void engineUpdate(byte b) throws java.security.SignatureException, TokenException
engineUpdate
in class SignatureSpi
java.security.SignatureException
TokenException
public void engineUpdate(byte[] b, int off, int len) throws java.security.SignatureException, TokenException
engineUpdate
in class SignatureSpi
java.security.SignatureException
TokenException
protected void engineUpdateNative(byte[] b, int off, int len) throws TokenException
TokenException
public byte[] engineSign() throws java.security.SignatureException, TokenException
engineSign
in class SignatureSpi
java.security.SignatureException
TokenException
public int engineSign(byte[] outbuf, int offset, int len) throws java.security.SignatureException, TokenException
engineSign
in class SignatureSpi
java.security.SignatureException
TokenException
public boolean engineVerify(byte[] sigBytes) throws java.security.SignatureException, TokenException
engineVerify
in class SignatureSpi
java.security.SignatureException
TokenException
protected static boolean engineRawVerifyNative(PK11Token token, java.security.PublicKey key, byte[] hash, byte[] signature) throws java.security.SignatureException, TokenException
java.security.SignatureException
TokenException
protected boolean engineVerifyNative(byte[] sigBytes) throws java.security.SignatureException, TokenException
java.security.SignatureException
TokenException
public void engineSetParameter(java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidAlgorithmParameterException, TokenException
engineSetParameter
in class SignatureSpi
java.security.InvalidAlgorithmParameterException
TokenException
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception