Code example for PublicKey

Methods: getEncoded

0
        } 
        else 
        { 
            try 
            { 
                byte[] bytes = publicKey.getEncoded();
 
                publicKey = JDKKeyFactory.createPublicKeyFromDERStream(bytes);
 
                if (publicKey instanceof ECPublicKey)
                { 
                    param = ECUtil.generatePublicKeyParameter(publicKey);
                } 
                else 
                { 
                    throw new InvalidKeyException("can't recognise key type in ECDSA based signer");
                } 
            } 
            catch (Exception e)
            { 
                throw new InvalidKeyException("can't recognise key type in ECDSA based signer");