Skip to content

Commit

Permalink
fix(webcomponents): fix downloading wrong DER format (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
donskov authored Jun 27, 2024
1 parent e304b1d commit 9073275
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class Pkcs10CertificateRequest extends AsnData<CertificationRequest> {

public downloadAsDER(name?: string) {
Download.csr.asDER(
this.toString('hex'),
this.raw,
name || this.commonName,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class X509AttributeCertificate extends AsnData<AttributeCertificate> {

public downloadAsDER(name?: string) {
Download.attrCert.asDER(
this.toString('hex'),
this.raw,
name || this.commonName,
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/webcomponents/src/crypto/x509_certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class X509Certificate extends AsnData<Certificate> {

public downloadAsDER(name?: string) {
Download.cert.asDER(
this.toString('hex'),
this.raw,
name || this.commonName,
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/webcomponents/src/crypto/x509_crl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class X509Crl extends AsnData<CertificateList> {

public downloadAsDER(name?: string) {
Download.crl.asDER(
this.toString('hex'),
this.raw,
name || this.commonName,
);
}
Expand Down
16 changes: 8 additions & 8 deletions packages/webcomponents/src/utils/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export class Download {
);
},

asDER: (hex: string, name: string) => {
asDER: (raw: ArrayBuffer, name: string) => {
downloadFromBuffer(
Convert.FromString(hex),
raw,
name,
'cer',
'application/pkix-cert',
Expand All @@ -41,9 +41,9 @@ export class Download {
);
},

asDER: (hex: string, name: string) => {
asDER: (raw: ArrayBuffer, name: string) => {
downloadFromBuffer(
Convert.FromString(hex),
raw,
name,
'cer',
'application/pkix-attr-cert',
Expand All @@ -61,9 +61,9 @@ export class Download {
);
},

asDER: (hex: string, name: string) => {
asDER: (raw: ArrayBuffer, name: string) => {
downloadFromBuffer(
Convert.FromString(hex),
raw,
name,
'csr',
'application/pkcs10',
Expand All @@ -81,9 +81,9 @@ export class Download {
);
},

asDER: (hex: string, name: string) => {
asDER: (raw: ArrayBuffer, name: string) => {
downloadFromBuffer(
Convert.FromString(hex),
raw,
name,
'crl',
'application/pkix-crl',
Expand Down

0 comments on commit 9073275

Please sign in to comment.