Documentation
¶
Overview ¶
Package crypto provides RFC 8291 encryption helpers and VAPID JWT construction for Web Push. These are pure cryptographic functions with no dependency on the push Service's state.
Index ¶
Constants ¶
View Source
const VAPIDExpWindow = 12 * 60 * 60
VAPIDExpWindow is the JWT expiry window in seconds (12 hours).
Variables ¶
This section is empty.
Functions ¶
func BuildVAPIDHeader ¶
func BuildVAPIDHeader(priv *ecdsa.PrivateKey, pubKeyB64, subject, endpoint string) (string, error)
BuildVAPIDHeader constructs a VAPID Authorization header (RFC 8292) from a pre-decoded ECDSA private key.
func DeriveKeyNonce ¶
func DeriveKeyNonce(shared, authSecret, clientPub, serverPub, salt []byte) (cek, nonce []byte, err error)
DeriveKeyNonce derives the content-encryption key and nonce per RFC 8291.
func ECDHToECDSA ¶
func ECDHToECDSA(key *ecdh.PrivateKey) (*ecdsa.PrivateKey, error)
ECDHToECDSA converts an ECDH P-256 private key to an ECDSA private key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.