Documentation ¶
Index ¶
- Variables
- func DecodeRSAKey(bytes []byte) (*rsa.PrivateKey, error)
- func DecodeRSAOAEP(key *rsa.PrivateKey, cipher []byte) ([]byte, error)
- func IsSignValid(hash, cipher string, key []byte) bool
- func Nonce(n int) (string, error)
- func ReadRSAKeyFromFile(path string) (*rsa.PrivateKey, error)
- func Sign(cipher, key []byte) []byte
- func SignEncodeBase64(cipher, key []byte) string
- type ReaderFunc
- type TokenLog
- type TokenTSLog
- type ValuesLog
- type WriterFunc
- type YubikeyLog
- type YubikeyTSLog
Constants ¶
This section is empty.
Variables ¶
var ( // ErrPEMDecode is used to be propagated up the call stack. // It is returned when something goes wrong in the crypt module. ErrPEMDecode = fmt.Errorf("failed to decode PEM block containing private key") )
Functions ¶
func DecodeRSAKey ¶
func DecodeRSAKey(bytes []byte) (*rsa.PrivateKey, error)
DecodeRSAKey decode a slice of bytes into an rsa.PrivateKey. It uses the x509.ParsePKCS1PrivateKey function under the hood
func DecodeRSAOAEP ¶
func DecodeRSAOAEP(key *rsa.PrivateKey, cipher []byte) ([]byte, error)
DecodeRSAOAEP decode a cipher using the rsa private key argument. It uses the rsa.DecryptOAEP function under the hood
func IsSignValid ¶
IsSignValid checks if the signature of a given cipher is valid with the given key
func ReadRSAKeyFromFile ¶
func ReadRSAKeyFromFile(path string) (*rsa.PrivateKey, error)
ReadRSAKeyFromFile read a file and decode the content into a rsa.PrivateKey
func SignEncodeBase64 ¶
SignEncodeBase64 sign a cipher and return the base64 signature
Types ¶
type ReaderFunc ¶
ReaderFunc is a wrapper for a function to implement the Reader interface
type TokenLog ¶
TokenLog is mapping yubico.Token to a logger
func (TokenLog) MarshalZerologObject ¶
MarshalZerologObject implements the zerolog interface to dump Token in logger
type TokenTSLog ¶
TokenTSLog is mapping yubico.Token timestamp to a logger
func (TokenTSLog) MarshalZerologObject ¶
func (ttl TokenTSLog) MarshalZerologObject(e *zerolog.Event)
MarshalZerologObject implements the zerolog interface to dump Token timestamp in logger
type ValuesLog ¶
ValuesLog is mapping url.Values to a logger
func (ValuesLog) MarshalZerologObject ¶
MarshalZerologObject implements the zerolog interface to dump values in logger
type WriterFunc ¶
WriterFunc is a wrapper for a function to implement the Writer interface
type YubikeyLog ¶
YubikeyLog is mapping yubico.Yubikey to a logger
func (YubikeyLog) MarshalZerologObject ¶
func (yl YubikeyLog) MarshalZerologObject(e *zerolog.Event)
MarshalZerologObject implements the zerolog interface to dump Yubikey in logger
type YubikeyTSLog ¶
YubikeyTSLog is mapping yubico.Yubikey timestamp to a logger
func (YubikeyTSLog) MarshalZerologObject ¶
func (ytl YubikeyTSLog) MarshalZerologObject(e *zerolog.Event)
MarshalZerologObject implements the zerolog interface to dump Yubikey timestamp in logger