Skip to content

Commit

Permalink
chore: padding pem
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Dec 3, 2024
1 parent af30cea commit 4ae483d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/x509-utils/src/x509/x509-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,10 @@ const getDNString = (typesAndValues: AttributeTypeAndValue[]): string => {
export const getCertificateSubjectPublicKeyJWK = async (pemOrDerCert: string | Uint8Array | Certificate): Promise<JWK> => {
const pemOrDerStr =
typeof pemOrDerCert === 'string'
? pemOrDerCert
? u8a.toString(u8a.fromString(pemOrDerCert, 'base64pad'), 'base64pad')
: pemOrDerCert instanceof Uint8Array
? u8a.toString(pemOrDerCert, 'base64pad')
: pemOrDerCert.toString('base64')
: u8a.toString(u8a.fromString(pemOrDerCert.toString('base64'), 'base64pad'), 'base64pad')
const pem = derToPEM(pemOrDerStr)
const certificate = pemOrDerToX509Certificate(pem)
var jwk: JWK | undefined
Expand Down

0 comments on commit 4ae483d

Please sign in to comment.