Examples of Extensions


Examples of org.apache.harmony.security.x509.Extensions

            new GeneralName(new byte[] {1, 1, 1, 1}),
            new GeneralName(8, "1.2.3.4444.55555")
        };
        GeneralNames sans = new GeneralNames(Arrays.asList(san));
        Extension extension = new Extension("2.5.29.17", true, sans.getEncoded());
        Extensions extensions = new Extensions();
        extensions.addExtension(extension);
       
        byte[] encoding = extensions.getEncoded();
        Extensions.ASN1.decode(encoding);
       
        TBSCertificate tbsCertificate = new TBSCertificate(version, serialNumber,
                signature, issuer, validity, subject, subjectPublicKeyInfo,
                issuerUniqueID, subjectUniqueID, extensions);
View Full Code Here

Examples of org.apache.harmony.security.x509.Extensions

        X500Principal issuer =
            new X500Principal("O=Certificate Issuer");
        // revoked certificate serial number
        BigInteger serialNumber = BigInteger.valueOf(555);
        // crl entry extensions
        Extensions crlEntryExtensions = new Extensions();
        // add reason code extension which OID is 2.5.29.21
        // see RFC 3280 http://www.ietf.org/rfc/rfc3280.txt
        crlEntryExtensions.addExtension(
                new Extension("2.5.29.21", Extension.NON_CRITICAL,
                    new ReasonCode(ReasonCode.KEY_COMPROMISE)));
        // crl entry
        X509CRLEntryImpl crlEntry = new X509CRLEntryImpl(
                new TBSCertList.RevokedCertificate(
View Full Code Here

Examples of org.apache.harmony.security.x509.Extensions

        Date genTime = new Date();
        BigInteger nonce = BigInteger.valueOf(1234567890L);
        // accuracy is 1 second
        int[] accuracy = new int[] { 1, 0, 0 };
        GeneralName tsa = new GeneralName(new Name("CN=AnAuthority"));
        Extensions exts = new Extensions();
        // Time-Stamping extension OID: as defined in RFC 3161
        int[] timeStampingExtOID = new int[] { 1, 3, 6, 1, 5, 5, 7, 3, 8 };
        byte[] timeStampingExtValue = new byte[] { (byte) 1, (byte) 2, (byte) 3 };
        Extension ext = new Extension(timeStampingExtOID, true,
                timeStampingExtValue);
        exts.addExtension(ext);

        TSTInfo tSTInfo = new TSTInfo(1, policy, msgImprint, BigInteger.TEN,
                genTime, accuracy, Boolean.FALSE, nonce, tsa, exts);
       
        Object[] issuerAndSerialNumber = new Object[] { new Name("CN=issuer"),
View Full Code Here

Examples of org.apache.harmony.security.x509.Extensions

        // SHA1 OID
        MessageImprint msgImprint = new MessageImprint(new AlgorithmIdentifier(
                "1.3.14.3.2.26"), new byte[20]);
        String reqPolicy = "1.2.3.4.5";
        BigInteger nonce = BigInteger.valueOf(1234567890L);
        Extensions exts = new Extensions();
        int[] extOID = new int[] { 1, 2, 3, 2, 1 };
        byte[] extValue = new byte[] { (byte) 1, (byte) 2, (byte) 3 };
        Extension ext = new Extension(extOID, false, extValue);
        exts.addExtension(ext);

        TimeStampReq req = new TimeStampReq(1, msgImprint, reqPolicy,
                nonce, Boolean.FALSE, exts);
        byte[] encoding = req.getEncoded();
        TimeStampReq decoded = (TimeStampReq) TimeStampReq.ASN1
View Full Code Here

Examples of org.apache.harmony.security.x509.Extensions

                sha1), new byte[20]);
        Date genTime = new Date();
        BigInteger nonce = BigInteger.valueOf(1234567890L);
        int[] accuracy = new int[] { 1, 0, 0 };
        GeneralName tsa = new GeneralName(new Name("CN=AnAuthority"));
        Extensions exts = new Extensions();
        // Time-Stamping extension OID: as defined in RFC 3161
        int[] timeStampingExtOID = new int[] { 1, 3, 6, 1, 5, 5, 7, 3, 8 };
        byte[] timeStampingExtValue = new byte[] { (byte) 1, (byte) 2, (byte) 3 };
        Extension ext = new Extension(timeStampingExtOID, true,
                timeStampingExtValue);
        exts.addExtension(ext);

        TSTInfo info = new TSTInfo(1, policy, msgImprint, BigInteger.TEN,
                genTime, accuracy, Boolean.FALSE, nonce, tsa, exts);

        byte[] encoding = TSTInfo.ASN1.encode(info);
View Full Code Here

Examples of org.apache.harmony.security.x509.Extensions

        boolean[] subjectUniqueID = new boolean[]
                    {false, true, false, true, false, true, false, true};

        Extension extension = new Extension("2.5.29.17",
                                            true, subjectAltNames.getEncoded());
        Extensions extensions = new Extensions();
        extensions.addExtension(extension);
      
        TBSCertificate tbsCertificate = new TBSCertificate(version,
                serialNumber, signature, issuer, validity, subject,
                subjectPublicKeyInfo, issuerUniqueID, subjectUniqueID,
                extensions);
View Full Code Here

Examples of org.apache.lucene.queryParser.ext.Extensions

    };
    this.index = new RAMDirectory();
    this.writer = new IndexWriter(this.index, new IndexWriterConfig(
        Version.LUCENE_36, this.analyzer));
    this.translator = new DocumentTranslator();
    Extensions ext = new Extensions('.');
    ext.add("near", new NearParserExtension());
    ext.add("erlang", new ErlangParserExtension(this.translator));
    ext.add("redis", new RedisParserExtension());
    this.extensions = ext;
    try {
      add(this.translator.convert(new OtpErlangList(new OtpErlangList(
          new OtpErlangTuple(new OtpErlangObject[] {
              new OtpErlangAtom("to"),
View Full Code Here

Examples of org.bouncycastle.asn1.x509.Extensions

        }
    }

    private Set getExtensionOIDs(boolean critical)
    {
        Extensions extensions = c.getExtensions();

        if (extensions != null)
        {
            Set set = new HashSet();
            Enumeration e = extensions.oids();

            while (e.hasMoreElements())
            {
                ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) e.nextElement();
                Extension ext = extensions.getExtension(oid);

                if (critical == ext.isCritical())
                {
                    set.add(oid.getId());
                }
View Full Code Here

Examples of org.bouncycastle.asn1.x509.Extensions

        return getExtensionOIDs(false);
    }

    private Extension getExtension(ASN1ObjectIdentifier oid)
    {
        Extensions exts = c.getExtensions();

        if (exts != null)
        {
            return exts.getExtension(oid);
        }

        return null;
    }
View Full Code Here

Examples of org.bouncycastle.asn1.x509.Extensions

        buf.append("      userCertificate: ").append(this.getSerialNumber()).append(nl);
        buf.append("       revocationDate: ").append(this.getRevocationDate()).append(nl);
        buf.append("       certificateIssuer: ").append(this.getCertificateIssuer()).append(nl);

        Extensions extensions = c.getExtensions();

        if (extensions != null)
        {
            Enumeration e = extensions.oids();
            if (e.hasMoreElements())
            {
                buf.append("   crlEntryExtensions:").append(nl);

                while (e.hasMoreElements())
                {
                    ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)e.nextElement();
                    Extension ext = extensions.getExtension(oid);
                    if (ext.getExtnValue() != null)
                    {
                        byte[]                  octs = ext.getExtnValue().getOctets();
                        ASN1InputStream dIn = new ASN1InputStream(octs);
                        buf.append("                       critical(").append(ext.isCritical()).append(") ");
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.