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; }
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; }
static public AsymmetricKeyParameter generatePublicKeyParameter( PublicKey key) throws InvalidKeyException { if (key instanceof GOST3410PublicKey) { GOST3410PublicKey k = (GOST3410PublicKey)key; GOST3410PublicKeyParameterSetSpec p = k.getParameters().getPublicKeyParameters(); return new GOST3410PublicKeyParameters(k.getY(), new GOST3410Parameters(p.getP(), p.getQ(), p.getA())); } throw new InvalidKeyException("can't identify GOST3410 public key: " + key.getClass().getName()); }
static public AsymmetricKeyParameter generatePublicKeyParameter( PublicKey key) throws InvalidKeyException { if (key instanceof GOST3410PublicKey) { GOST3410PublicKey k = (GOST3410PublicKey)key; GOST3410PublicKeyParameterSetSpec p = k.getParameters().getPublicKeyParameters(); return new GOST3410PublicKeyParameters(k.getY(), new GOST3410Parameters(p.getP(), p.getQ(), p.getA())); } throw new InvalidKeyException("can't identify GOST3410 public key: " + key.getClass().getName()); }
static public 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."); } }
static public 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."); } }
return new GOST3410Parameters(p, q, a, new GOST3410ValidationParameters(x0, c)); return new GOST3410Parameters(p, q, a, new GOST3410ValidationParameters(x0L, cL));
return new GOST3410Parameters(p, q, a, new GOST3410ValidationParameters(x0, c)); return new GOST3410Parameters(p, q, a, new GOST3410ValidationParameters(x0L, cL));