Versions in this module Expand all Collapse all v0 v0.1.0 Jul 9, 2026 Changes in this version + func Decrypt(enc Encryptor, token string) ([]byte, error) + func Encrypt(enc Encryptor, plaintext []byte) (string, error) + func FormatToken(scheme string, ciphertext []byte) string + func IsToken(s string) bool + func LoadCertificate(pemBytes []byte) (*x509.Certificate, error) + func LoadPrivateKey(pemBytes []byte) (*rsa.PrivateKey, error) + func ParseToken(s string) (scheme string, ciphertext []byte, err error) + type Encryptor interface + Decrypt func(ciphertext []byte) ([]byte, error) + Encrypt func(plaintext []byte) ([]byte, error) + Name func() string + type KeyOptions struct + Bits int + NotAfter time.Time + NotBefore time.Time + Rand io.Reader + Serial *big.Int + type KeyPair struct + PrivateKeyPEM []byte + PublicKeyPEM []byte + func CreateKeys(opts *KeyOptions) (*KeyPair, error) + type PKCS7 struct + Cert *x509.Certificate + Key *rsa.PrivateKey + Rand io.Reader + func NewPKCS7(certPEM, keyPEM []byte) (*PKCS7, error) + func (p *PKCS7) Decrypt(ciphertext []byte) ([]byte, error) + func (p *PKCS7) Encrypt(plaintext []byte) ([]byte, error) + func (p *PKCS7) Name() string