Refine search
private void readObject(java.io.ObjectInputStream in) throws NotActiveException, IOException, ClassNotFoundException { in.defaultReadObject(); params = new DSAParameterSpec(p, q, g); }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.dsaSpec = new DSAParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()); }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { this.y = (BigInteger)in.readObject(); this.dsaSpec = new DSAParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()); }
/** * Creates object from DSAPrivateKeySpec. * * @param keySpec - a DSAPrivateKeySpec object */ public DSAPrivateKeyImpl(DSAPrivateKeySpec keySpec) { super("DSA"); PrivateKeyInfo pki; g = keySpec.getG(); p = keySpec.getP(); q = keySpec.getQ(); ThreeIntegerSequence threeInts = new ThreeIntegerSequence(p .toByteArray(), q.toByteArray(), g.toByteArray()); AlgorithmIdentifier ai = new AlgorithmIdentifier(AlgNameMapper .map2OID("DSA"), threeInts.getEncoded()); x = keySpec.getX(); pki = new PrivateKeyInfo(0, ai, ASN1Integer.getInstance().encode( x.toByteArray()), null); setEncoding(pki.getEncoded()); params = new DSAParameterSpec(p, q, g); }
@Override public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException { this.random = random; if (params instanceof DSAParameterSpec) { DSAParameterSpec dsaParams = (DSAParameterSpec) params; BigInteger gInt = dsaParams.getG(); if (gInt != null) { g = gInt.toByteArray(); } BigInteger pInt = dsaParams.getP(); if (pInt != null) { p = pInt.toByteArray(); } BigInteger qInt = dsaParams.getQ(); if (qInt != null) { q = qInt.toByteArray(); } } else if (params != null) { throw new InvalidAlgorithmParameterException("Params must be DSAParameterSpec"); } } }
public static DSAParameterSpec getDSAParameterSpec(int plength, int qlength, SecureRandom random) { DSAParameterSpec spec = cache.get(plength + "-" + qlength); if (spec != null) { return new DSAParameterSpec(spec.getP(), spec.getQ(), spec.getG()); } return getNewDSAParameterSpec(plength, qlength, random); }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.dsaSpec = new DSAParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()); }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { this.y = (BigInteger)in.readObject(); this.dsaSpec = new DSAParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()); }
/** * Creates object from DSAPublicKeySpec. * * @param keySpec - a DSAPublicKeySpec object */ public DSAPublicKeyImpl(DSAPublicKeySpec keySpec) { super("DSA"); SubjectPublicKeyInfo spki; p = keySpec.getP(); q = keySpec.getQ(); g = keySpec.getG(); ThreeIntegerSequence threeInts = new ThreeIntegerSequence(p .toByteArray(), q.toByteArray(), g.toByteArray()); AlgorithmIdentifier ai = new AlgorithmIdentifier(AlgNameMapper .map2OID("DSA"), threeInts.getEncoded()); y = keySpec.getY(); spki = new SubjectPublicKeyInfo(ai, ASN1Integer.getInstance().encode( y.toByteArray())); setEncoding(spki.getEncoded()); params = (DSAParams) (new DSAParameterSpec(p, q, g)); }
@Override public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException { this.random = random; if (params instanceof DSAParameterSpec) { DSAParameterSpec dsaParams = (DSAParameterSpec) params; BigInteger gInt = dsaParams.getG(); if (gInt != null) { g = gInt.toByteArray(); } BigInteger pInt = dsaParams.getP(); if (pInt != null) { p = pInt.toByteArray(); } BigInteger qInt = dsaParams.getQ(); if (qInt != null) { q = qInt.toByteArray(); } } else if (params != null) { throw new InvalidAlgorithmParameterException("Params must be DSAParameterSpec"); } } }
public static DSAParameterSpec getDSAParameterSpec(int plength, int qlength, SecureRandom random) { DSAParameterSpec spec = cache.get(plength + "-" + qlength); if (spec != null) { return new DSAParameterSpec(spec.getP(), spec.getQ(), spec.getG()); } return getNewDSAParameterSpec(plength, qlength, random); }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.dsaSpec = new DSAParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()); }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { this.y = (BigInteger)in.readObject(); this.dsaSpec = new DSAParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()); }
private void readObject(java.io.ObjectInputStream in) throws NotActiveException, IOException, ClassNotFoundException { in.defaultReadObject(); params = new DSAParameterSpec(p, q, g); }
q = new BigInteger(threeInts.q); g = new BigInteger(threeInts.g); params = (DSAParams) (new DSAParameterSpec(p, q, g));
/** * Return the X.509 ASN.1 structure DSAParameter. * <p/> * <pre> * DSAParameter ::= SEQUENCE { * prime INTEGER, -- p * subprime INTEGER, -- q * base INTEGER, -- g} * </pre> */ protected byte[] engineGetEncoded() { DSAParameter dsaP = new DSAParameter(currentSpec.getP(), currentSpec.getQ(), currentSpec.getG()); try { return dsaP.getEncoded(ASN1Encoding.DER); } catch (IOException e) { throw new RuntimeException("Error encoding DSAParameters"); } }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.dsaSpec = new DSAParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()); }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { this.y = (BigInteger)in.readObject(); this.dsaSpec = new DSAParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject()); }
private void readObject(java.io.ObjectInputStream in) throws NotActiveException, IOException, ClassNotFoundException { in.defaultReadObject(); params = new DSAParameterSpec(p, q, g); }
q = new BigInteger(threeInts.q); g = new BigInteger(threeInts.g); params = new DSAParameterSpec(p, q, g); setEncoding(encoding);