Package org.mozilla.jss.pkix.primitive

Examples of org.mozilla.jss.pkix.primitive.AlgorithmIdentifier


        byte[] data = ((X509EncodedKeySpec) keySpec).getEncoded();
        SEQUENCE ecPublicKey = (SEQUENCE) outer
            .decode(new ByteArrayInputStream(data));

        AlgorithmIdentifier algid = (AlgorithmIdentifier) ecPublicKey
            .elementAt(0);
        if (!algid.getOID().toString().equals("{1 2 840 10045 2 1}")) // ecPublicKey
          throw new IllegalArgumentException("Unsupported key");

        ECParameterSpec params = EcCore.getParams(decodeOID(algid
            .getParameters()));

        BIT_STRING bs = (BIT_STRING) ecPublicKey.elementAt(1);
        data = bs.getBits();
View Full Code Here


        PrivateKeyInfo.Template pkiTemp = new PrivateKeyInfo.Template();
        byte[] data = ((PKCS8EncodedKeySpec) keySpec).getEncoded();
        PrivateKeyInfo pki = (PrivateKeyInfo) pkiTemp
            .decode(new ByteArrayInputStream(data));

        AlgorithmIdentifier algid = pki.getPrivateKeyAlgorithm();
        if (!algid.getOID().toString().equals("{1 2 840 10045 2 1}")) // ecPublicKey
          throw new IllegalArgumentException("Unsupported key");

        ECParameterSpec params = EcCore.getParams(decodeOID(algid
            .getParameters()));

        SEQUENCE.Template foo = new SEQUENCE.Template();
        foo.addElement(new INTEGER.Template());
        foo.addElement(new OCTET_STRING.Template());
View Full Code Here

TOP

Related Classes of org.mozilla.jss.pkix.primitive.AlgorithmIdentifier

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.