Documentation
¶
Index ¶
- type JSONSigner
- func (s *JSONSigner) Counter() uint32
- func (s *JSONSigner) RegisterKey(applicationParam []byte) ([]byte, *big.Int, *big.Int, error)
- func (s *JSONSigner) SignASN1(keyHandle, applicationParam, digest []byte) ([]byte, error)
- func (s *JSONSigner) SignASN1WithRPID(keyHandle, applicationParam, digest []byte, rpid string) ([]byte, error)
- type JSONStore
- type KeyData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONSigner ¶
type JSONSigner struct {
// contains filtered or unexported fields
}
JSONSigner implements the Signer interface using JSON file for persistence
func New ¶
func New(storePath string) (*JSONSigner, error)
New creates a new JSONSigner that persists keys to the given path
func (*JSONSigner) Counter ¶
func (s *JSONSigner) Counter() uint32
Counter returns a monotonically increasing counter
func (*JSONSigner) RegisterKey ¶
RegisterKey generates a new key and returns its handle, X and Y coordinates
func (*JSONSigner) SignASN1 ¶
func (s *JSONSigner) SignASN1(keyHandle, applicationParam, digest []byte) ([]byte, error)
SignASN1 signs the digest using the provided key handle
func (*JSONSigner) SignASN1WithRPID ¶
func (s *JSONSigner) SignASN1WithRPID(keyHandle, applicationParam, digest []byte, rpid string) ([]byte, error)
SignASN1WithRPID is a compatibility function that simply forwards to SignASN1 Since we're using fingerprint-only auth, we don't need strict RPID validation
type JSONStore ¶
type JSONStore struct { Keys map[string]KeyData `json:"keys"` // Map of key handles to key data Counter uint32 `json:"counter"` // Monotonically increasing counter MasterKeyHash string `json:"master_key_hash"` // Hash of master key for verification CreatedAt time.Time `json:"created_at"` // When this store was created LastUpdated time.Time `json:"last_updated"` // When this store was last updated }
JSONStore is the persistent storage for all registered keys
type KeyData ¶
type KeyData struct { KeyHandle string `json:"key_handle"` // Base64 encoded key handle PrivateKeyD string `json:"private_key_d"` // Base64 encoded private key D component PublicKeyX string `json:"public_key_x"` // Base64 encoded public key X component PublicKeyY string `json:"public_key_y"` // Base64 encoded public key Y component AppParameter string `json:"app_parameter"` // Base64 encoded application parameter CreatedAt time.Time `json:"created_at"` // When the key was created LastUsed time.Time `json:"last_used"` // When the key was last used UseCount int `json:"use_count"` // Number of times the key has been used }
KeyData stores information about a registered key
Click to show internal directories.
Click to hide internal directories.