Code example for PublicKey

Methods: getEncoded

0
 
        sigBits = sig.sign();
    } 
 
    private ASN1Primitive getKeySpec() throws NoSuchAlgorithmException, 
            InvalidKeySpecException, NoSuchProviderException 
    { 
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
        ASN1Primitive obj = null;
        try 
        { 
 
            baos.write(pubkey.getEncoded());
            baos.close();
 
            ASN1InputStream derin = new ASN1InputStream(
                    new ByteArrayInputStream(baos.toByteArray()));
 
            obj = derin.readObject();
        }