Documentation ¶
Index ¶
- func DecryptRequest(request model.WorkerRequest, rsaPrivateKey *rsa.PrivateKey) ([]byte, error)
- func EncryptRequest(content []byte, rsaPublicKey *rsa.PublicKey) (contentEncrypted []byte, encryptionType string, err error)
- func FingerprintPublicKey(key *rsa.PublicKey, challengeLevel uint, fingerprintLengthInGroups uint) (string, error)
- func GenerateCertificateBytes(privateKey *rsa.PrivateKey, validFor time.Duration, hosts []string) ([]byte, error)
- func GeneratePrivateKey(rsaKeySize int) (*rsa.PrivateKey, error)
- func GeneratePublicKeyBytes(privateKey *rsa.PrivateKey) ([]byte, error)
- func MarshalPrivateKeyToPEMBytes(key *rsa.PrivateKey) []byte
- func UnmarshalCertificateFromPEMBytes(bytes []byte) (*x509.Certificate, error)
- func UnmarshalPrivateKeyFromPEMBytes(bytes []byte) (*rsa.PrivateKey, error)
- func UnmarshalPublicKey(publicKeyBytes []byte) (*rsa.PublicKey, error)
- type VerifyByFingerprint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptRequest ¶
func DecryptRequest(request model.WorkerRequest, rsaPrivateKey *rsa.PrivateKey) ([]byte, error)
func EncryptRequest ¶
func FingerprintPublicKey ¶
func GeneratePrivateKey ¶
func GeneratePrivateKey(rsaKeySize int) (*rsa.PrivateKey, error)
func GeneratePublicKeyBytes ¶
func GeneratePublicKeyBytes(privateKey *rsa.PrivateKey) ([]byte, error)
func MarshalPrivateKeyToPEMBytes ¶
func MarshalPrivateKeyToPEMBytes(key *rsa.PrivateKey) []byte
func UnmarshalCertificateFromPEMBytes ¶
func UnmarshalCertificateFromPEMBytes(bytes []byte) (*x509.Certificate, error)
func UnmarshalPrivateKeyFromPEMBytes ¶
func UnmarshalPrivateKeyFromPEMBytes(bytes []byte) (*rsa.PrivateKey, error)
Types ¶
type VerifyByFingerprint ¶
type VerifyByFingerprint struct { Fingerprint string FingerprintChallengeLevel uint FingerprintLength uint }
func (*VerifyByFingerprint) VerifyPeerCertificate ¶
func (v *VerifyByFingerprint) VerifyPeerCertificate(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error
VerifyPeerCertificate validates that one of the given certificates contains a public key matching the configured fingerprint.
Click to show internal directories.
Click to hide internal directories.