Code example for PublicKey

Methods: getEncoded

0
        } 
        else 
        { 
            try 
            { 
                byte[]  bytes = publicKey.getEncoded();
 
                publicKey = new BCDSAPublicKey(SubjectPublicKeyInfo.getInstance(bytes));
 
                if (publicKey instanceof DSAKey)
                { 
                    param = DSAUtil.generatePublicKeyParameter(publicKey);
                } 
                else 
                { 
                    throw new InvalidKeyException("can't recognise key type in DSA based signer");
                } 
            } 
            catch (Exception e)
            { 
                throw new InvalidKeyException("can't recognise key type in DSA based signer");