use of com.github.zhenwei.provider.jce.spec.GOST3410PublicKeyParameterSetSpec in project LinLong-Java by zhenwei1108.
the class KeyPairGeneratorSpi method init.
private void init(GOST3410ParameterSpec gParams, SecureRandom random) {
GOST3410PublicKeyParameterSetSpec spec = gParams.getPublicKeyParameters();
param = new GOST3410KeyGenerationParameters(random, new GOST3410Parameters(spec.getP(), spec.getQ(), spec.getA()));
engine.init(param);
initialised = true;
gost3410Params = gParams;
}
use of com.github.zhenwei.provider.jce.spec.GOST3410PublicKeyParameterSetSpec in project LinLong-Java by zhenwei1108.
the class GOST3410Util method generatePrivateKeyParameter.
public static AsymmetricKeyParameter generatePrivateKeyParameter(PrivateKey key) throws InvalidKeyException {
if (key instanceof GOST3410PrivateKey) {
GOST3410PrivateKey k = (GOST3410PrivateKey) key;
GOST3410PublicKeyParameterSetSpec p = k.getParameters().getPublicKeyParameters();
return new GOST3410PrivateKeyParameters(k.getX(), new GOST3410Parameters(p.getP(), p.getQ(), p.getA()));
}
throw new InvalidKeyException("can't identify GOST3410 private key.");
}
Aggregations