< prev index next >
src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java
Print this page
*** 29,38 ****
--- 29,39 ----
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.security.*;
import java.security.interfaces.*;
+ import java.security.spec.AlgorithmParameterSpec;
import sun.nio.ch.DirectBuffer;
import sun.security.util.*;
import sun.security.x509.AlgorithmId;
*** 432,441 ****
--- 433,443 ----
("Key is too short for this signature algorithm");
}
}
// see JCA spec
+ @Override
protected void engineInitVerify(PublicKey publicKey)
throws InvalidKeyException {
if (publicKey == null) {
throw new InvalidKeyException("Key must not be null");
}
*** 448,457 ****
--- 450,460 ----
p11Key = P11KeyFactory.convertKey(token, publicKey, keyAlgorithm);
initialize();
}
// see JCA spec
+ @Override
protected void engineInitSign(PrivateKey privateKey)
throws InvalidKeyException {
if (privateKey == null) {
throw new InvalidKeyException("Key must not be null");
}
*** 464,473 ****
--- 467,477 ----
p11Key = P11KeyFactory.convertKey(token, privateKey, keyAlgorithm);
initialize();
}
// see JCA spec
+ @Override
protected void engineUpdate(byte b) throws SignatureException {
ensureInitialized();
switch (type) {
case T_UPDATE:
buffer[0] = b;
*** 488,497 ****
--- 492,502 ----
throw new ProviderException("Internal error");
}
}
// see JCA spec
+ @Override
protected void engineUpdate(byte[] b, int ofs, int len)
throws SignatureException {
ensureInitialized();
if (len == 0) {
return;
*** 525,534 ****
--- 530,540 ----
throw new ProviderException("Internal error");
}
}
// see JCA spec
+ @Override
protected void engineUpdate(ByteBuffer byteBuffer) {
ensureInitialized();
int len = byteBuffer.remaining();
if (len <= 0) {
return;
*** 572,581 ****
--- 578,588 ----
throw new ProviderException("Internal error");
}
}
// see JCA spec
+ @Override
protected byte[] engineSign() throws SignatureException {
ensureInitialized();
try {
byte[] signature;
if (type == T_UPDATE) {
*** 631,640 ****
--- 638,648 ----
session = token.releaseSession(session);
}
}
// see JCA spec
+ @Override
protected boolean engineVerify(byte[] signature) throws SignatureException {
ensureInitialized();
try {
if (!p1363Format) {
if (keyAlgorithm.equals("DSA")) {
*** 822,838 ****
--- 830,863 ----
return t;
}
// see JCA spec
@SuppressWarnings("deprecation")
+ @Override
protected void engineSetParameter(String param, Object value)
throws InvalidParameterException {
throw new UnsupportedOperationException("setParameter() not supported");
}
// see JCA spec
+ @Override
+ protected void engineSetParameter(AlgorithmParameterSpec params)
+ throws InvalidAlgorithmParameterException {
+ if (params != null) {
+ throw new InvalidAlgorithmParameterException("No parameter accepted");
+ }
+ }
+
+ // see JCA spec
@SuppressWarnings("deprecation")
+ @Override
protected Object engineGetParameter(String param)
throws InvalidParameterException {
throw new UnsupportedOperationException("getParameter() not supported");
}
+
+ // see JCA spec
+ @Override
+ protected AlgorithmParameters engineGetParameters() {
+ return null;
+ }
}
< prev index next >