Skip to content

Commit

Permalink
WIP update certificate
Browse files Browse the repository at this point in the history
Signed-off-by: David Liu <david-khala@hotmail.com>
  • Loading branch information
davidkhala committed Feb 6, 2024
1 parent 45ad6a4 commit 24c2db9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
19 changes: 10 additions & 9 deletions axios/test/cert.pem
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBkzCCATmgAwIBAgIBBDAKBggqhkjOPQQDAjA3MRswGQYDVQQDDBJCQ01DQ0Js
b2NrY2hhaW5BcHAxCzAJBgNVBAoMAkJDMQswCQYDVQQGEwJISzAiGA8yMDE5MDMx
NDExMTYxOVoYDzIwMTkwMzE1MDUxOTM5WjA3MRswGQYDVQQDDBJCQ01DQ0Jsb2Nr
Y2hhaW5BcHAxCzAJBgNVBAoMAkJDMQswCQYDVQQGEwJISzBZMBMGByqGSM49AgEG
CCqGSM49AwEHA0IABOOMhRnkaBN8huqlQi3FUd/EaLmLA8/M4xSiv1sLcW5fqlYl
2+dF6QXSIIN2K3caXQY9MK4TiCkw5JipfBjpXNyjMjAwMAwGA1UdEwEB/wQCMAAw
CwYDVR0PBAQDAgbAMBMGA1UdJQQMMAoGCCsGAQUFBwMCMAoGCCqGSM49BAMCA0gA
MEUCIQCHVZkb+G9GcYwj95+SlAqhJFNVFVZwnVL5HTC3qQutUgIgCEkqB3kB11rq
CCMzUyarzim9NY2khywBt6nKea8/SKU=
MIIBrjCCAVOgAwIBAgIKNjogusqInoD8oDAKBggqhkjOPQQDAjBTMREwDwYDVQQG
Ewhob25na29uZzEUMBIGA1UECgwLaHlwZXJsZWRnZXIxEzARBgNVBAsMCmJsb2Nr
Y2hhaW4xEzARBgNVBAMMCmRhdmlka2hhbGEwHhcNMjQwMjA2MTI1MzA4WhcNMzQw
MjA2MDcwMDQ4WjBTMREwDwYDVQQGEwhob25na29uZzEUMBIGA1UECgwLaHlwZXJs
ZWRnZXIxEzARBgNVBAsMCmJsb2NrY2hhaW4xEzARBgNVBAMMCmRhdmlka2hhbGEw
WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQFE66B74NjN7u50OjspqX9TspN3vvY
Km1I3yrFmZd+RXuxyYx7A6nqG2fKCJjLK2VVBihKQPeAoagvESlxFHe7ow8wDTAL
BgNVHQ8EBAMCBaAwCgYIKoZIzj0EAwIDSQAwRgIhAIlceKrVsr6elWk4JyA975S4
kGQ4kDwwEwPxt8csWwoIAiEAxPwpq2XYponrLIHPM9K69e6Vfd7aZkvYuA/9MoDh
D2M=
-----END CERTIFICATE-----
1 change: 0 additions & 1 deletion crypto/pkcs10.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {asn1, crypto} from 'jsrsasign';
import {hex2pem} from './format.js';
import {Attribute} from './attribute.js';

const {DERBitString, DERSequence} = asn1;
const {CertificationRequestInfo} = asn1.csr;
Expand Down
9 changes: 0 additions & 9 deletions crypto/test/artifacts/csr.pem

This file was deleted.

7 changes: 4 additions & 3 deletions crypto/test/ecdsaTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import path from 'path';
import {Extension} from '../extension.js';
import {X509Time} from '../x509.js';
import {filedirname} from '@davidkhala/light/es6.mjs';
import {year} from '@davidkhala/light/constants.js';

filedirname(import.meta);

Expand Down Expand Up @@ -44,11 +45,11 @@ describe('key pair', () => {
x500Name.setOrganizationName('hyperledger');
x500Name.setOrgUnitName('blockchain');
x500Name.setCommonName('davidkhala');
const expiryTime = new X509Time(Date.now() + 31556926000);
const expiryTime = new X509Time(Date.now() + 10 * year);
const cert = keypair.generateX509Certificate({subject: x500Name, expiryTime});

const keyPath = path.resolve(__dirname, 'fixture/key.pem');
const certPath = path.resolve(__dirname, 'fixture/cert.pem');
const keyPath = path.resolve(__dirname, 'artifacts/key.pem');
const certPath = path.resolve(__dirname, 'artifacts/cert.pem');
fs.writeFileSync(keyPath, prvKeyPem);
fs.writeFileSync(certPath, cert.getPEM());
});
Expand Down
Empty file removed crypto/test/fixture/.gitkeep
Empty file.

0 comments on commit 24c2db9

Please sign in to comment.