public boolean equals(Object o) { if (!(o instanceof JCEECPublicKey)) { return false; } JCEECPublicKey other = (JCEECPublicKey)o; return engineGetQ().equals(other.engineGetQ()) && (engineGetSpec().equals(other.engineGetSpec())); }
private void writeObject( ObjectOutputStream out) throws IOException { out.writeObject(this.getEncoded()); out.writeObject(algorithm); out.writeBoolean(withCompression); } }
JCEECPublicKey( SubjectPublicKeyInfo info) { populateFromPubKeyInfo(info); }
byte[] encKey = new byte[64]; extractBytes(encKey, 0, bX); extractBytes(encKey, 32, bY); ECCurve curve = this.engineGetQ().getCurve(); ASN1OctetString p = (ASN1OctetString) new X9ECPoint(curve.createPoint(this.getQ().getX().toBigInteger(), this.getQ().getY().toBigInteger(), withCompression)).toASN1Primitive();
public JCEECPublicKey( String algorithm, ECPublicKeyParameters params, ECParameterSpec spec) { ECDomainParameters dp = params.getParameters(); this.algorithm = algorithm; this.q = params.getQ(); if (spec == null) { EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed()); this.ecSpec = createSpec(ellipticCurve, dp); } else { this.ecSpec = spec; } }
byte[] encKey = new byte[64]; extractBytes(encKey, 0, bX); extractBytes(encKey, 32, bY); ECCurve curve = this.engineGetQ().getCurve(); ASN1OctetString p = (ASN1OctetString) new X9ECPoint(curve.createPoint(this.getQ().getAffineXCoord().toBigInteger(), this.getQ().getAffineYCoord().toBigInteger(), withCompression)).toASN1Primitive();
public JCEECPublicKey( String algorithm, ECPublicKeyParameters params, ECParameterSpec spec) { ECDomainParameters dp = params.getParameters(); this.algorithm = algorithm; this.q = params.getQ(); if (spec == null) { EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed()); this.ecSpec = createSpec(ellipticCurve, dp); } else { this.ecSpec = spec; } }
public boolean equals(Object o) { if (!(o instanceof JCEECPublicKey)) { return false; } JCEECPublicKey other = (JCEECPublicKey)o; return engineGetQ().equals(other.engineGetQ()) && (engineGetSpec().equals(other.engineGetSpec())); }
private void writeObject( ObjectOutputStream out) throws IOException { out.writeObject(this.getEncoded()); out.writeObject(algorithm); out.writeBoolean(withCompression); } }
JCEECPublicKey( SubjectPublicKeyInfo info) { populateFromPubKeyInfo(info); }
public JCEECPublicKey( String algorithm, ECPublicKeyParameters params, org.spongycastle.jce.spec.ECParameterSpec spec) { ECDomainParameters dp = params.getParameters(); this.algorithm = algorithm; this.q = params.getQ(); if (spec == null) { EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed()); this.ecSpec = createSpec(ellipticCurve, dp); } else { EllipticCurve ellipticCurve = EC5Util.convertCurve(spec.getCurve(), spec.getSeed()); this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec); } }
public int hashCode() { return engineGetQ().hashCode() ^ engineGetSpec().hashCode(); }
private DERBitString getPublicKeyDetails(JCEECPublicKey pub) { try { SubjectPublicKeyInfo info = SubjectPublicKeyInfo.getInstance(ASN1Primitive.fromByteArray(pub.getEncoded())); return info.getPublicKeyData(); } catch (IOException e) { // should never happen return null; } }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { byte[] enc = (byte[])in.readObject(); populateFromPubKeyInfo(SubjectPublicKeyInfo.getInstance(ASN1Primitive.fromByteArray(enc))); this.algorithm = (String)in.readObject(); this.withCompression = in.readBoolean(); }
public JCEECPublicKey( String algorithm, ECPublicKeyParameters params, org.spongycastle.jce.spec.ECParameterSpec spec) { ECDomainParameters dp = params.getParameters(); this.algorithm = algorithm; this.q = params.getQ(); if (spec == null) { EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed()); this.ecSpec = createSpec(ellipticCurve, dp); } else { EllipticCurve ellipticCurve = EC5Util.convertCurve(spec.getCurve(), spec.getSeed()); this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec); } }
public int hashCode() { return engineGetQ().hashCode() ^ engineGetSpec().hashCode(); }
private DERBitString getPublicKeyDetails(JCEECPublicKey pub) { try { SubjectPublicKeyInfo info = SubjectPublicKeyInfo.getInstance(ASN1Primitive.fromByteArray(pub.getEncoded())); return info.getPublicKeyData(); } catch (IOException e) { // should never happen return null; } }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { byte[] enc = (byte[])in.readObject(); populateFromPubKeyInfo(SubjectPublicKeyInfo.getInstance(ASN1Primitive.fromByteArray(enc))); this.algorithm = (String)in.readObject(); this.withCompression = in.readBoolean(); }