Code example for AlgorithmParameters

Methods: getEncoded

0
    public AlgorithmIdentifier getAlgorithmIdentifier(ASN1ObjectIdentifier algId, AlgorithmParameters parameters)
        throws InvalidAlgorithmParameterException
    { 
        try 
        { 
            ASN1Encodable params = ASN1Primitive.fromByteArray(parameters.getEncoded());
 
            return new AlgorithmIdentifier(algId, params);
        } 
        catch (IOException e)
        { 
            throw new InvalidAlgorithmParameterException("unable to encode parameters object: " + e.getMessage());
        } 
    } 
 
    public AlgorithmIdentifier getAlgorithmIdentifier(ASN1ObjectIdentifier algorithm, AlgorithmParameterSpec algorithmSpec)
        throws InvalidAlgorithmParameterException
    { 
        if (algorithmSpec instanceof OAEPParameterSpec)
        {