Documentation ¶
Overview ¶
Package chefcrypto bundles up crytographic routines for goairdi (and anything else that might need it).
Index ¶
- func Auth12HeaderVerify(pkPem string, hashed, sig []byte) error
- func Auth13HeaderVerify(pkPem string, hashed, sig []byte) error
- func GenerateRSAKeys() (string, string, error)
- func GenerateSalt() ([]byte, error)
- func HashPasswd(passwd string, salt []byte) (string, error)
- func HeaderDecrypt(pkPem string, data string) ([]byte, error)
- func PemToPrivateKey(privPem string) (*rsa.PrivateKey, error)
- func PemToPublicKey(pubPem string) (rsa.PublicKey, error)
- func PrivateKeyToString(priv *rsa.PrivateKey) (string, error)
- func PublicKeyToString(pub rsa.PublicKey) (string, error)
- func SignTextBlock(textBlock string, privKey *rsa.PrivateKey) (string, error)
- func ValidatePublicKey(publicKey interface{}) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Auth12HeaderVerify ¶
Auth12HeaderVerify verifies the newer version 1.2 Chef authentication protocol headers.
func Auth13HeaderVerify ¶ added in v0.2.0
Auth12HeaderVerify verifies the even newer version 1.3 Chef authentication protocol headers
func GenerateRSAKeys ¶
GenerateRSAKeys creates a pair of private and public keys for a client.
func GenerateSalt ¶
GenerateSalt makes a new salt for hashing a password.
func HashPasswd ¶
HashPasswd SHA512 hashes a password string with the provided salt.
func HeaderDecrypt ¶
HeaderDecrypt decrypts the encrypted header with the client or user's public key for validating requests. This function is informed by chef-golang's privateDecrypt function.
func PemToPrivateKey ¶ added in v1.0.0
func PemToPrivateKey(privPem string) (*rsa.PrivateKey, error)
PemToPrivateKey converts a given pem encoded private key into a proper and usable *rsa.PrivateKey.
func PemToPublicKey ¶ added in v1.0.0
PemToPublicKey converts a pem encoded public key to a proper rsa.PublicKey.
func PrivateKeyToString ¶ added in v1.0.0
func PrivateKeyToString(priv *rsa.PrivateKey) (string, error)
PrivateKeyToString stringifies a private key.
func PublicKeyToString ¶ added in v1.0.0
PublicKeyToString stringifies a private key.
func SignTextBlock ¶
func SignTextBlock(textBlock string, privKey *rsa.PrivateKey) (string, error)
SignTextBlock signs a block of text using the provided private RSA key. Used by shovey to sign requests that the client can verify.
func ValidatePublicKey ¶
ValidatePublicKey checks that the provided public key is valid.
Types ¶
This section is empty.