Get full algorithm from API
KINFOO opened this issue · 1 comments
KINFOO commented
Hi,
Using https://fortifyapp.com/examples/signing, I manage to read full algorithm ECDSA with SHA256 (1.2.840.10045.4.3.2)
How can I get this value from API?
Context
Using public certificate, I am not able to get better than ECDSA
with
(event: any) => {
const certificate = await provider.certStorage.getItem(event.detail.certificateId);
const chain = await provider.certStorage.getChain(certificate);
const certificateChain = chain.map((part: any) => new pkijs.Certificate({ schema: fromBER(part.value).result }));
const publicCertificate = await certificateChain[0].getPublicKey();
console.log(publicCertificate.algorithm.name);
}
Question
How is it possible to get full algorithm from API?
KINFOO commented
Well I use OID and it is all right.
(event: any) => {
const certificate = await provider.certStorage.getItem(event.detail.certificateId);
const chain = await provider.certStorage.getChain(certificate);
const certificateChain = chain.map((part: any) => new pkijs.Certificate({ schema: fromBER(part.value).result }));
const signerCertificate = certificateChain[certificateChain.length - 1];
const OID = signerCertificate.signatureAlgorithm.algorithmId;
console.log(OID);
}