Documentation ¶
Index ¶
- Variables
- func LoadAndQueryCertificateForAccount(ctx context.Context, cctx client.Context, fin io.Reader) (tls.Certificate, error)
- func ValidatePeerCertificates(ctx context.Context, cquery ctypes.QueryClient, certs []*x509.Certificate, ...) (sdk.Address, *x509.Certificate, error)
- type CertificateInvalidError
- type InvalidReason
- type KeyPairManager
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AuthVersionOID = asn1.ObjectIdentifier{2, 23, 133, 2, 6} ErrCertificate = errors.New("certificate error") ErrInvalidSerialFlag = fmt.Errorf("%w: invalid value in serial flag. expected integer", ErrCertificate) )
Functions ¶
func LoadAndQueryCertificateForAccount ¶
func LoadAndQueryCertificateForAccount(ctx context.Context, cctx client.Context, fin io.Reader) (tls.Certificate, error)
LoadAndQueryCertificateForAccount wraps LoadAndQueryPEMForAccount and tls.X509KeyPair
func ValidatePeerCertificates ¶
func ValidatePeerCertificates(ctx context.Context, cquery ctypes.QueryClient, certs []*x509.Certificate, usage []x509.ExtKeyUsage) (sdk.Address, *x509.Certificate, error)
Types ¶
type CertificateInvalidError ¶
type CertificateInvalidError struct { Cert *x509.Certificate Reason InvalidReason }
func (CertificateInvalidError) Error ¶
func (e CertificateInvalidError) Error() string
type InvalidReason ¶
type InvalidReason int
const ( EmptyPeerCertificate InvalidReason = iota TooManyPeerCertificates InvalidCN InvalidSN Expired Decode X509Parse Verify )
type KeyPairManager ¶
type KeyPairManager interface { KeyExists() (bool, error) Generate(notBefore, notAfter time.Time, domains []string) error // Read the PEM blocks, containing the cert, private key, & public key Read(fin ...io.Reader) ([]byte, []byte, []byte, error) ReadX509KeyPair(fin ...io.Reader) (*x509.Certificate, tls.Certificate, error) }
func NewKeyPairManager ¶
func NewKeyPairManager(cctx sdkclient.Context, fromAddress sdk.AccAddress) (KeyPairManager, error)
Click to show internal directories.
Click to hide internal directories.