@sphereon/ssi-sdk-ext.x509-utils
Advanced tools
Comparing version 0.24.1-unstable.10 to 0.24.1-unstable.63
@@ -19,2 +19,3 @@ import { Certificate } from 'pkijs'; | ||
export declare const PEMToHex: (PEM: string, headerKey?: string) => string; | ||
export declare function PEMToBinary(pem: string): Uint8Array; | ||
/** | ||
@@ -21,0 +22,0 @@ * Converts a base64 encoded string to hex string, removing any non-base64 characters, including newlines |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.derToPEM = exports.PEMToDer = exports.hexToPEM = exports.hexToBase64 = exports.base64ToHex = exports.PEMToHex = exports.publicKeyHexFromPEM = exports.hexKeyFromPEMBasedJwk = exports.privateKeyHexFromPEM = exports.PEMToJwk = exports.jwkToPEM = exports.toKeyObject = exports.areCertificatesEqual = exports.pemOrDerToX509Certificate = exports.x5cToPemCertChain = exports.pemCertChainTox5c = void 0; | ||
exports.derToPEM = exports.PEMToDer = exports.hexToPEM = exports.hexToBase64 = exports.base64ToHex = exports.PEMToBinary = exports.PEMToHex = exports.publicKeyHexFromPEM = exports.hexKeyFromPEMBasedJwk = exports.privateKeyHexFromPEM = exports.PEMToJwk = exports.jwkToPEM = exports.toKeyObject = exports.areCertificatesEqual = exports.pemOrDerToX509Certificate = exports.x5cToPemCertChain = exports.pemCertChainTox5c = void 0; | ||
const pkijs_1 = require("pkijs"); | ||
@@ -150,2 +150,10 @@ const u8a = __importStar(require("uint8arrays")); | ||
exports.PEMToHex = PEMToHex; | ||
function PEMToBinary(pem) { | ||
const pemContents = pem | ||
.replace(/^[^]*-----BEGIN [^-]+-----/, '') | ||
.replace(/-----END [^-]+-----[^]*$/, '') | ||
.replace(/\s/g, ''); | ||
return u8a.fromString(pemContents, 'base64pad'); | ||
} | ||
exports.PEMToBinary = PEMToBinary; | ||
/** | ||
@@ -152,0 +160,0 @@ * Converts a base64 encoded string to hex string, removing any non-base64 characters, including newlines |
{ | ||
"name": "@sphereon/ssi-sdk-ext.x509-utils", | ||
"description": "Sphereon SSI-SDK plugin functions for X.509 Certificate handling.", | ||
"version": "0.24.1-unstable.10+61bd444", | ||
"version": "0.24.1-unstable.63+adfc57a", | ||
"source": "src/index.ts", | ||
@@ -39,3 +39,3 @@ "main": "dist/index.js", | ||
], | ||
"gitHead": "61bd4445b8a7e3da5bac0412d4359d9bf66df50c" | ||
"gitHead": "adfc57aea4001853b32c0a0b0c910ea79ed83edf" | ||
} |
@@ -121,2 +121,11 @@ import { Certificate } from 'pkijs' | ||
export function PEMToBinary(pem: string): Uint8Array { | ||
const pemContents = pem | ||
.replace(/^[^]*-----BEGIN [^-]+-----/, '') | ||
.replace(/-----END [^-]+-----[^]*$/, '') | ||
.replace(/\s/g, '') | ||
return u8a.fromString(pemContents, 'base64pad') | ||
} | ||
/** | ||
@@ -123,0 +132,0 @@ * Converts a base64 encoded string to hex string, removing any non-base64 characters, including newlines |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
81818
1178