I'm using BouncyCastle 1.54.
I have a JCE algorithm string - like "ECDSAwithSHA256" (for example).
I need an org.bouncycastle.asn1.x509.AlgorithmIdentifier object.
Alternatively, I could create an AlgorithmIdentifier object from an OID, but that begs the question of how to translate an algorithm string into an OID instead.
I could create a giant if/else, but there's got to be a standard way to do this.
You can use the algorithm finders of BouncyCastle (see javadoc)
The
AlgorithmIdentifier
OID's obtained forSHA256withECDSA
(notECDSAwithSHA256
, see bouncycastle specifications) will be