Documentation
¶
Overview ¶
Package cose provides COSE Sign1 signing and verification for Signet tokens. This implementation uses veraison/go-cose for COSE message handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenericSigner ¶
type GenericSigner[K any] struct { // contains filtered or unexported fields }
GenericSigner implements COSE Sign1 signing. The private key is securely managed and automatically zeroed when Destroy() is called.
CONCURRENCY: GenericSigner is safe for concurrent Sign() calls from multiple goroutines. However, callers MUST externally synchronize Destroy() calls to ensure they happen only after all Sign() operations are complete. Calling Destroy() concurrently with Sign() may result in Sign() operations failing with "signer has been destroyed" errors.
func NewECDSAP256Signer ¶
func NewECDSAP256Signer(privateKey *ecdsa.PrivateKey) (*GenericSigner[*ecdsa.PrivateKey], error)
NewECDSAP256Signer creates a new COSE signer for ECDSA P-256
func NewEd25519Signer ¶
func NewEd25519Signer(privateKey ed25519.PrivateKey) (*GenericSigner[ed25519.PrivateKey], error)
NewEd25519Signer creates a new COSE signer for Ed25519
func (*GenericSigner[K]) Destroy ¶
func (s *GenericSigner[K]) Destroy()
Destroy securely zeros the private key from memory. After calling Destroy, the signer cannot be used. This is idempotent - calling multiple times is safe. SECURITY: The zeroizer is mandatory and will panic if not set.
type GenericVerifier ¶
type GenericVerifier[K any] struct { // contains filtered or unexported fields }
GenericVerifier implements COSE Sign1 verification. Verifiers are safe for concurrent use.
func NewECDSAP256Verifier ¶
NewECDSAP256Verifier creates a new COSE verifier for ECDSA P-256
func NewEd25519Verifier ¶
NewEd25519Verifier creates a new COSE verifier for Ed25519
type Signer ¶
Signer interface for COSE signing with lifecycle management. All implementations must support secure destruction of cryptographic material.