Examples of DerInputStream


Examples of org.bouncycastle.asn1.DERInputStream

    */
   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

Examples of org.bouncycastle.asn1.DERInputStream

            X509Name proxyDN = req.getCertificationRequestInfo().getSubject();
            X500Principal userDN = cert.getSubjectX500Principal();

            ByteArrayInputStream bIn = new ByteArrayInputStream(
                    userDN.getEncoded());
            DERInputStream dIn = new DERInputStream(bIn);
            ASN1Sequence      seq = (ASN1Sequence) dIn.readObject();
            X509Name uDN = new X509Name(seq);

            Log.debug(CLASS_NAME,
                    "user's subjectDN: " + uDN.toString()
                    + "\nproxy's subjectDN: " + proxyDN.toString());
View Full Code Here

Examples of org.bouncycastle.asn1.DERInputStream

        return TBSCertificateStructure.getInstance(derObject);
    }

    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

Examples of org.bouncycastle.asn1.DERInputStream

    }

    public static DERObject toDERObject(byte[] datathrows IOException {

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

        return derInputStream.readObject();
    }
View Full Code Here

Examples of sun.security.util.DerInputStream

    return (SecretKey) keySpec;
  }

  // Parses the service ticket (GSS AP-REQ token)
  private EncryptionKey parseServiceTicket(byte[] ticket) throws Exception {
    DerInputStream ticketStream = new DerInputStream(ticket);
    DerValue[] values = ticketStream.getSet(ticket.length, true);

    // Look for the AP_REQ.
    // AP-REQ ::= [APPLICATION 14] SEQUENCE
    for (int i = 0; i < values.length; i++) {
      DerValue value = values[i];
View Full Code Here

Examples of sun.security.util.DerInputStream

                    debug.println("X509CRLSelector.match: no CRLNumber");
                }
            }
            BigInteger crlNum;
            try {
                DerInputStream in = new DerInputStream(crlNumExtVal);
                byte[] encoded = in.getOctetString();
                CRLNumberExtension crlNumExt =
                    new CRLNumberExtension(Boolean.FALSE, encoded);
                crlNum = crlNumExt.get(CRLNumberExtension.NUMBER);
            } catch (IOException ex) {
                if (debug != null) {
View Full Code Here

Examples of sun.security.util.DerInputStream

        }
        byte[] rawExtVal = cert.getExtensionValue(EXTENSION_OIDS[extId]);
        if (rawExtVal == null) {
            return null;
        }
        DerInputStream in = new DerInputStream(rawExtVal);
        byte[] encoded = in.getOctetString();
        switch (extId) {
        case PRIVATE_KEY_USAGE_ID:
            try {
                return new PrivateKeyUsageExtension(FALSE, encoded);
            } catch (CertificateException ex) {
View Full Code Here

Examples of sun.security.util.DerInputStream

                    debug.println("X509CertSelector.match: "
                        + "no subject key ID extension");
                }
                return false;
            }
            DerInputStream in = new DerInputStream(extVal);
            byte[] certSubjectKeyID = in.getOctetString();
            if (certSubjectKeyID == null ||
                    !Arrays.equals(subjectKeyID, certSubjectKeyID)) {
                if (debug != null) {
                    debug.println("X509CertSelector.match: "
                        + "subject key IDs don't match");
View Full Code Here

Examples of sun.security.util.DerInputStream

                    debug.println("X509CertSelector.match: "
                        + "no authority key ID extension");
                }
                return false;
            }
            DerInputStream in = new DerInputStream(extVal);
            byte[] certAuthKeyID = in.getOctetString();
            if (certAuthKeyID == null ||
                    !Arrays.equals(authorityKeyID, certAuthKeyID)) {
                if (debug != null) {
                    debug.println("X509CertSelector.match: "
                        + "authority key IDs don't match");
View Full Code Here

Examples of sun.security.util.DerInputStream

  }
  byte[] rawExtVal = cert.getExtensionValue(EXTENSION_OIDS[extId]);
  if (rawExtVal == null) {
      return null;
  }
  DerInputStream in = new DerInputStream(rawExtVal);
  byte[] encoded = in.getOctetString();
  switch (extId) {
  case PRIVATE_KEY_USAGE_ID:
      try {
    return new PrivateKeyUsageExtension(FALSE, encoded);
      } catch (CertificateException ex) {
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.