byCode

Finds or creates a HashAndSign instance by the given hash and signature algorithm codes.

First searches for a matching algorithm pair in SupportedSignatureAlgorithms. If not found, creates a new HashAndSign instance with the given codes.

Report a problem

Return

a HashAndSign instance, or null if the signature algorithm is unknown

Parameters

hash

the numeric code of the hash algorithm

sign

the numeric code of the signature algorithm

Throws

if sign is the anonymous signature code

if hash is an unknown hash algorithm code