use of org.bouncycastle.jce.interfaces.ECKey in project XobotOS by xamarin.
the class Signature method engineInitSign.
protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException {
CipherParameters param;
if (privateKey instanceof ECKey) {
param = ECUtil.generatePrivateKeyParameter(privateKey);
} else {
throw new InvalidKeyException("can't recognise key type in ECDSA based signer");
}
digest.reset();
if (random != null) {
signer.init(true, new ParametersWithRandom(param, random));
} else {
signer.init(true, param);
}
}
Aggregations