49 lines
1.3 KiB
Markdown
49 lines
1.3 KiB
Markdown
|
# Certificate API
|
||
|
## Library of Code sp-us | Board of Directors
|
||
|
|
||
|
This is an HTTP API which provides information on the x509 certificates deployed on TLS sites.
|
||
|
You can self-host this yourself, however you're more than welcome to use the public API at https://certapi.libraryofcode.org/
|
||
|
|
||
|
### How to Query
|
||
|
Send a GET request to `https://certapi.libraryofcode.org` with the query parameter `q` set to equal the site you wish to dial.
|
||
|
Ex: `https://certapi.libraryofcode.org/?q=www.google.com`
|
||
|
|
||
|
### Response & Types
|
||
|
#### Error
|
||
|
If the status !== `true`, there will be a message field which displays the error.
|
||
|
```ts
|
||
|
{
|
||
|
status: false,
|
||
|
message: string,
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### 200 | SUCCESS
|
||
|
```ts
|
||
|
{
|
||
|
status: true | false,
|
||
|
subject: {
|
||
|
commonName: string,
|
||
|
organization: string[],
|
||
|
organizationalUnit: string[],
|
||
|
locality: string[],
|
||
|
country: string[],
|
||
|
},
|
||
|
issuer: {
|
||
|
commonName: string,
|
||
|
organization: string[],
|
||
|
organizationalUnit: string[],
|
||
|
locality: string[],
|
||
|
country: string[],
|
||
|
},
|
||
|
validationType: 'DV' | 'OV' | 'EV',
|
||
|
signatureAlgorithm: string,
|
||
|
publicKeyAlgorithm: string,
|
||
|
serialNumber: number,
|
||
|
notAfter: Date,
|
||
|
extendedKeyUsage: ['All/Any Usages', 'TLS Web Server Authentication', 'TLS Web Client Authentication', 'Code Signing', 'E-mail Protection (S/MIME)'],
|
||
|
san: string,
|
||
|
fingerprint: string,
|
||
|
}
|
||
|
```
|