@peculiar/x509
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -16,2 +16,3 @@ import { Name as AsnName } from "@peculiar/asn1-x509"; | ||
private extraNames; | ||
static isASCII(text: string): boolean; | ||
private asn; | ||
@@ -18,0 +19,0 @@ constructor(data: BufferSource | AsnName | string | JsonName, extraNames?: IdOrName); |
@@ -392,2 +392,11 @@ /*! | ||
} | ||
static isASCII(text) { | ||
for (let i = 0; i < text.length; i++) { | ||
const code = text.charCodeAt(i); | ||
if (code > 0xFF) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
getName(idOrName) { | ||
@@ -458,3 +467,8 @@ return this.extraNames.get(idOrName) || names.get(idOrName); | ||
else { | ||
attr.value.printableString = value; | ||
if (Name.isASCII(value)) { | ||
attr.value.printableString = value; | ||
} | ||
else { | ||
attr.value.utf8String = value; | ||
} | ||
} | ||
@@ -461,0 +475,0 @@ } |
{ | ||
"name": "@peculiar/x509", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "@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", | ||
@@ -5,0 +5,0 @@ "main": "build/x509.cjs.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
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
328868
4289