Closed fmonniot closed 3 years ago
@fmonniot Thank you for pointing to this issue
RFC5480 says that ECDSA parameters are ABSENT
. I fixed the problem and published the new version @peculiar/x509@1.3.2
SEQUENCE :
OBJECT IDENTIFIER : 1.2.840.10045.4.1
is there a way to overrides the default algorithm mapping?
This module uses DI. It makes it possible to replace implementations in runtime.
import { diAlgorithm } from "@peculiar/x509";
import { container, injectable } from "tsyringe";
@injectable()
export class EcAlgorithmEx extends EcAlgorithm {
// your own implementation here
}
// Register algorithm provider
container.registerSingleton(diAlgorithm, EdAlgorithm);
Thank you, the new version does fix my issue. Thanks for pointing out how to work with the DI solution, much appreciated !
Hello there,
I was trying to use the
ecdsa-with-SHA256
algorithm to sign my certificates, but it seems the ASN.1 encoding generated includes aNULL
attribute. For example here is the beginning of a certificate as generated by this library:I generated another certificate through another source and that one doesn't have the
NULL
attribute:Reading RFC3279, it seems the parameters field must not be present. I modified https://github.com/PeculiarVentures/x509/blob/69ee3ff4467c4fe5cffa2ea7449851954bc45e26/src/ec_algorithm.ts#L21-L29 locally by using
undefined
instead ofnull
and it seems to remove theNULL
field.Is it something you'd consider accepting in the library? If not, is there a way to overrides the default algorithm mapping ?
Thanks !