public byte[] getEncoded() { if (info != null) { return KeyUtil.getEncodedSubjectPublicKeyInfo(info); } return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.dhKeyAgreement, new DHParameter(dhSpec.getP(), dhSpec.getG(), dhSpec.getL())), new DERInteger(y)); }
public byte[] getEncoded() { if (info != null) { return KeyUtil.getEncodedSubjectPublicKeyInfo(info); } return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.dhKeyAgreement, new DHParameter(dhSpec.getP(), dhSpec.getG(), dhSpec.getL()).toASN1Primitive()), new ASN1Integer(y)); }
/** * Return the PKCS#3 ASN.1 structure DHParameter. * <p> * <pre> * DHParameter ::= SEQUENCE { * prime INTEGER, -- p * base INTEGER, -- g * privateValueLength INTEGER OPTIONAL} * </pre> */ protected byte[] engineGetEncoded() { DHParameter dhP = new DHParameter(currentSpec.getP(), currentSpec.getG(), currentSpec.getL()); try { return dhP.getEncoded(ASN1Encoding.DER); } catch (IOException e) { throw new RuntimeException("Error encoding DHParameters"); } }
public byte[] getEncoded() { if (info != null) { return KeyUtil.getEncodedSubjectPublicKeyInfo(info); } return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.dhKeyAgreement, new DHParameter(dhSpec.getP(), dhSpec.getG(), dhSpec.getL())), new ASN1Integer(y)); }