List of usage examples for org.bouncycastle.asn1.pkcs DHParameter getEncoded
public byte[] getEncoded(String encoding) throws IOException
From source file:org.dcache.xrootd.plugins.authn.gsi.DHSession.java
License:Open Source License
/** * Creates an DER-encoded byte sequence from the DHParameter object * @param paramspec the DH parameter object * @return the DER-encoded byte sequence of the DH Parameter object */// w ww . j av a 2 s.c om private static byte[] toDER(DHParameterSpec paramspec) throws IOException { DHParameter derParams = new DHParameter(paramspec.getP(), // Prime // (public // key) paramspec.getG(), // generator paramspec.getP().bitLength()); // keylength of Prime return derParams.getEncoded("DER"); }