@peculiar/x509 is an easy to use TypeScript/Javascript library based on @peculiar/asn1-schema that makes generating X.509 Certificates and Certificate Requests as well as validating certificate chains easy
Describe the bug:
The method RsaAlgorithm.toAsnAlgorithm in rsa_algorithm.ts throws an error when the hash property in the algorithm object is a string, rather than an AlgorithmIdentifier.
Describe the bug: The method
RsaAlgorithm.toAsnAlgorithm
inrsa_algorithm.ts
throws an error when thehash
property in the algorithm object is a string, rather than anAlgorithmIdentifier
.To Reproduce:
RsaAlgorithm.toAsnAlgorithm
method.Expected behavior: The method should handle string values for
hash
.Reference: https://github.com/PeculiarVentures/x509/blob/ebbefa71161d00b79bdafa526b60eeea4f9f568e/src/rsa_algorithm.ts#L17
Additional context: Allowing string types for the hash property could improve the user experience and reduce confusion.