Package sun.security.util

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


                    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

        }
        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

                    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

                    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

  }
  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

        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

        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

        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 = (BigInteger)crlNumExt.get(CRLNumberExtension.NUMBER);
      } catch (IOException ex) {
    if (debug != null) {
View Full Code Here

                /* Extract DER encoding */
                derenc = X509CertificateChainHelper.extract(any);
            }

            DerInputStream din = new DerInputStream(derenc);

            /**
             * Size specified for getSequence() is 1 and is just
             * used as a guess by the method getSequence().
             */
            DerValue[] derval = din.getSequence(1);
            X509Certificate[] certchain =
                        new X509CertImpl[derval.length];
            /**
             * X509Certificate does not have a constructor which can
             * be used to instantiate objects from DER encodings. So
View Full Code Here

TOP

Related Classes of sun.security.util.DerInputStream

Copyright © 2018 www.massapicom. 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.