Package org.apache.geronimo.util.asn1

Examples of org.apache.geronimo.util.asn1.DERInputStream.readObject()


    private static DERObject toDer(byte [] data) {
        try {
            DERInputStream derInput =
                new DERInputStream(new ByteArrayInputStream(data));
            return derInput.readObject();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here


    public static DERObject toDERObject(byte[] datathrows IOException {

        ByteArrayInputStream inStream = new ByteArrayInputStream(data);
        DERInputStream derInputStream = new DERInputStream(inStream);

        return derInputStream.readObject();
    }

    // convert Proxy certificate to PEM format.
    public static void writePEMStr(StringBuffer sb, byte[] cert)
        throws IOException {
View Full Code Here

   private static BigInteger[] convertASN1toBIGINT(byte derbytes[])
           throws IOException {

      ByteArrayInputStream bIn = new ByteArrayInputStream(derbytes);
      DERInputStream dIn = new DERInputStream(bIn);
      DERConstructedSequence seq = (DERConstructedSequence) dIn.readObject();
      BigInteger r = ((DERInteger) seq.getObjectAt(0)).getValue();
      BigInteger s = ((DERInteger) seq.getObjectAt(1)).getValue();
      BigInteger result[] = new BigInteger[2];

      result[0] = r;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.