Package jcifs.spnego.asn1

Examples of jcifs.spnego.asn1.DERInputStream


    private BigInteger[] derDecode(
        byte[]  encoding)
        throws IOException
    {
        ByteArrayInputStream    bIn = new ByteArrayInputStream(encoding);
        DERInputStream          dIn = new DERInputStream(bIn);
        ASN1Sequence            s = (ASN1Sequence)dIn.readObject();

        BigInteger[]            sig = new BigInteger[2];

        sig[0] = ((DERInteger)s.getObjectAt(0)).getValue();
        sig[1] = ((DERInteger)s.getObjectAt(1)).getValue();
View Full Code Here


    private Certificate readDERCertificate(
        InputStream in)
        throws IOException
    {
        DERInputStream  dIn = new DERInputStream(in);
        ASN1Sequence    seq = (ASN1Sequence)dIn.readObject();

        if (seq.size() > 1
                && seq.getObjectAt(0) instanceof DERObjectIdentifier)
        {
            if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData))
View Full Code Here

    private CRL readDERCRL(
        InputStream in)
        throws IOException
    {
        DERInputStream  dIn = new DERInputStream(in);

        return new X509CRLObject(new CertificateList((ASN1Sequence)dIn.readObject()));
    }
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

            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

        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

    }

    public static DERObject toDERObject(byte[] datathrows IOException {

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

        return derInputStream.readObject();
    }
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

        final ByteArrayInputStream in =
                new ByteArrayInputStream(pubkey.getEncoded());
        final SubjectPublicKeyInfo spki =
                new SubjectPublicKeyInfo(
                        (ASN1Sequence)new DERInputStream(in).readObject());
        final SubjectKeyIdentifier ski = new SubjectKeyIdentifier(spki);

        final ByteArrayInputStream in2 =
                new ByteArrayInputStream(newprincipal.getEncoded());
        final GeneralNames generalNames = new GeneralNames(
                (ASN1Sequence)new DERInputStream(in2).readObject());
        final AuthorityKeyIdentifier aki =
                new AuthorityKeyIdentifier(spki, generalNames, BigInteger.ZERO);


        this.certGen.addExtension(X509Extensions.BasicConstraints,
View Full Code Here

        final ByteArrayInputStream in =
                new ByteArrayInputStream(pubkey.getEncoded());
        final SubjectPublicKeyInfo spki =
                new SubjectPublicKeyInfo(
                        (ASN1Sequence)new DERInputStream(in).readObject());
        final SubjectKeyIdentifier ski = new SubjectKeyIdentifier(spki);

        final ByteArrayInputStream in2 =
                new ByteArrayInputStream(newprincipal.getEncoded());
        final GeneralNames generalNames = new GeneralNames(
                (ASN1Sequence)new DERInputStream(in2).readObject());
        final AuthorityKeyIdentifier aki =
                new AuthorityKeyIdentifier(spki, generalNames, BigInteger.ZERO);


        this.certGen.addExtension(X509Extensions.BasicConstraints,
View Full Code Here

TOP

Related Classes of jcifs.spnego.asn1.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.