2019-10-20 19:28:35 -04:00
|
|
|
declare module '@ghaiklor/x509' {
|
|
|
|
namespace Certificate {
|
|
|
|
interface Issuer {
|
|
|
|
countryName: string,
|
|
|
|
stateOrProvinceName: string,
|
|
|
|
localityName: string,
|
|
|
|
organizationName: string,
|
2019-10-30 00:03:28 -04:00
|
|
|
organizationalUnitName: string,
|
|
|
|
commonName: string,
|
|
|
|
emailAddress: string
|
2019-10-20 19:28:35 -04:00
|
|
|
}
|
|
|
|
interface Subject {
|
|
|
|
countryName: string,
|
|
|
|
postalCode: string,
|
|
|
|
stateOrProvinceName: string,
|
|
|
|
localityName: string,
|
|
|
|
streetAddress: string,
|
|
|
|
organizationName: string,
|
|
|
|
organizationalUnitName: string,
|
2019-10-30 00:03:28 -04:00
|
|
|
commonName: string,
|
|
|
|
emailAddress: string
|
2019-10-20 19:28:35 -04:00
|
|
|
}
|
|
|
|
interface Extensions {
|
|
|
|
keyUsage: string,
|
|
|
|
authorityInformationAccess: string,
|
|
|
|
certificatePolicies: string,
|
|
|
|
basicConstraints: string,
|
|
|
|
cRLDistributionPoints: string,
|
|
|
|
subjectAlternativeName: string,
|
|
|
|
extendedKeyUsage: string,
|
|
|
|
authorityKeyIdentifier: string,
|
|
|
|
subjectKeyIdentifier: string,
|
|
|
|
cTPrecertificateSCTs: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
interface FullCertificate {
|
|
|
|
version: number,
|
|
|
|
subject: Certificate.Subject,
|
|
|
|
issuer: Certificate.Issuer,
|
2019-10-30 00:03:28 -04:00
|
|
|
fingerPrint: string,
|
|
|
|
serial: string,
|
2019-10-20 19:28:35 -04:00
|
|
|
notBefore: Date,
|
|
|
|
notAfter: Date,
|
|
|
|
subjectHash: string,
|
|
|
|
signatureAlgorithm: string,
|
|
|
|
publicKey: { algorithm: string };
|
|
|
|
altNames: string[]
|
|
|
|
extensions: Certificate.Extensions
|
|
|
|
}
|
|
|
|
function getAltNames(cert: string): string[];
|
|
|
|
function getIssuer(cert: string): Certificate.Issuer;
|
|
|
|
function getSubject(cert: string): Certificate.Subject;
|
|
|
|
function parseCert(cert: string): FullCertificate
|
|
|
|
}
|