validateForTlsServer
Validates a certificate chain for TLS server use: chain verification + serverAuth EKU (leaf + intermediate propagation)
- DNS/IP identity matching.
ts
function validateForTlsServer(
input: ValidateForTlsServerInput,
): Promise<VerifyChainResult>Parameters
input:ValidateForTlsServerInput
Examples
ts
import { validateForTlsServer } from 'micro509';
const result = await validateForTlsServer({
leaf: serverCertPem,
roots: [rootCaPem],
serviceIdentity: { type: 'dns', value: 'example.com' },
});
if (result.ok) {
console.log('valid for', result.value.leaf.subject.values.commonName);
}