use of com.sun.org.apache.xml.internal.security.signature.XMLSignatureException in project jdk8u_jdk by JetBrains.
the class IntegrityHmac method engineInitSign.
/**
* Method engineInitSign
*
* @param secretKey
* @param algorithmParameterSpec
* @throws XMLSignatureException
*/
protected void engineInitSign(Key secretKey, AlgorithmParameterSpec algorithmParameterSpec) throws XMLSignatureException {
if (!(secretKey instanceof SecretKey)) {
String supplied = secretKey.getClass().getName();
String needed = SecretKey.class.getName();
Object[] exArgs = { supplied, needed };
throw new XMLSignatureException("algorithms.WrongKeyForThisOperation", exArgs);
}
try {
this.macAlgorithm.init(secretKey, algorithmParameterSpec);
} catch (InvalidKeyException ex) {
throw new XMLSignatureException("empty", ex);
} catch (InvalidAlgorithmParameterException ex) {
throw new XMLSignatureException("empty", ex);
}
}
use of com.sun.org.apache.xml.internal.security.signature.XMLSignatureException in project jdk8u_jdk by JetBrains.
the class SignatureECDSA method engineInitSign.
/** @inheritDoc */
protected void engineInitSign(Key privateKey) throws XMLSignatureException {
if (!(privateKey instanceof PrivateKey)) {
String supplied = privateKey.getClass().getName();
String needed = PrivateKey.class.getName();
Object[] exArgs = { supplied, needed };
throw new XMLSignatureException("algorithms.WrongKeyForThisOperation", exArgs);
}
try {
this.signatureAlgorithm.initSign((PrivateKey) privateKey);
} catch (InvalidKeyException ex) {
throw new XMLSignatureException("empty", ex);
}
}
Aggregations