Pinned

data class Pinned(val sha256: Set<String>) : TrustAnchors

Trust a certificate only if the SHA-256 of its subject public key info matches one of sha256.

Pinning the key rather than the certificate is what lets a server renew without the client being rebuilt, as long as the key is kept. Pin more than one: a pin set with a single entry becomes an outage the moment that key has to be rotated in a hurry.

openssl x509 -in server.pem -pubkey -noout |
openssl pkey -pubin -outform der |
openssl dgst -sha256 -binary | base64

Constructors

Link copied to clipboard
constructor(sha256: Set<String>)

Properties

Link copied to clipboard

base64-encoded SHA-256 hashes, in the form the command above prints.