Documentation ¶
Overview ¶
Package parlca provides a self-signed certificate authority
Index ¶
- Constants
- func EnsureClient(cert *x509.Certificate)
- func EnsureSelfSigned(cert *x509.Certificate)
- func EnsureServer(cert *x509.Certificate)
- func EnsureTemplate(cert *x509.Certificate)
- type Certificate
- type CertificateAuthority
- type CertificateDER
- type DER
- type Ed25519KeyPair
- func (key *Ed25519KeyPair) Algo() (algo x509.PublicKeyAlgorithm)
- func (key *Ed25519KeyPair) Bytes() (bytes KeyDER, err error)
- func (key *Ed25519KeyPair) HasKey() (hasKey bool)
- func (key *Ed25519KeyPair) Private() (signer crypto.Signer)
- func (key *Ed25519KeyPair) PrivateBytes() (bytes []byte)
- func (key *Ed25519KeyPair) PublicBytes() (bytes []byte)
- type KeyDER
- type KeyGenerator
- type KeyPair
- type PrivateKey
- type SelfSigned
- func (ca *SelfSigned) Check() (isValid bool, cert *x509.Certificate, err error)
- func (ca *SelfSigned) DER() (bytes CertificateDER)
- func (ca *SelfSigned) HasDER() (hasDER bool)
- func (ca *SelfSigned) SetReader(reader io.Reader)
- func (ca *SelfSigned) Sign(template *x509.Certificate, publicKey crypto.PublicKey) (certDER CertificateDER, err error)
Constants ¶
View Source
const (
/*
NoPassword PasswordType = "\tnoPassword"
GeneratePassword PasswordType = "\tgeneratePassword"
GenerateOnTheFly Strategy = iota << 0
UseFileSystem
DefaultStrategy = GenerateOnTheFly
*/
DefaultCountry = "US"
)
Variables ¶
This section is empty.
Functions ¶
func EnsureClient ¶
func EnsureClient(cert *x509.Certificate)
func EnsureSelfSigned ¶
func EnsureSelfSigned(cert *x509.Certificate)
func EnsureServer ¶
func EnsureServer(cert *x509.Certificate)
func EnsureTemplate ¶
func EnsureTemplate(cert *x509.Certificate)
Types ¶
type Certificate ¶
type Certificate interface {
DER() (der CertificateDER)
}
type CertificateAuthority ¶
type CertificateAuthority interface { Check() (isValid bool, cert *x509.Certificate, err error) // gets x509.Certificate version DER() (bytes CertificateDER) // untyped bytes, der: Distinguished Encoding Rules binary format Sign(template *x509.Certificate, publicKey crypto.PublicKey) (certDER CertificateDER, err error) SetReader(reader io.Reader) }
func NewSelfSigned ¶
func NewSelfSigned(canonicalName string) (ca CertificateAuthority)
func NewCertificateAuthority()
type CertificateDER ¶
type CertificateDER []byte
type Ed25519KeyPair ¶
type Ed25519KeyPair struct { // func (ed25519.PrivateKey).Equal(x crypto.PrivateKey) bool // func (ed25519.PrivateKey).Public() crypto.PublicKey // func (ed25519.PrivateKey).Seed() []byte // func (ed25519.PrivateKey).Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) // implements crypto.Signer: Public, Sign ed25519.PrivateKey // type: []byte }
func (*Ed25519KeyPair) Algo ¶
func (key *Ed25519KeyPair) Algo() (algo x509.PublicKeyAlgorithm)
func (*Ed25519KeyPair) Bytes ¶
func (key *Ed25519KeyPair) Bytes() (bytes KeyDER, err error)
func (*Ed25519KeyPair) HasKey ¶
func (key *Ed25519KeyPair) HasKey() (hasKey bool)
func (*Ed25519KeyPair) Private ¶
func (key *Ed25519KeyPair) Private() (signer crypto.Signer)
func (*Ed25519KeyPair) PrivateBytes ¶
func (key *Ed25519KeyPair) PrivateBytes() (bytes []byte)
func (*Ed25519KeyPair) PublicBytes ¶
func (key *Ed25519KeyPair) PublicBytes() (bytes []byte)
type KeyGenerator ¶
type KeyPair ¶
type KeyPair interface { PrivateKey Bytes() (bytes KeyDER, err error) // untyped key material, both private and public keys PublicBytes() (bytes []byte) // untyped public key material Private() (signer crypto.Signer) // typed key material implementing crypto.Signer for x509.CreateCertificate and tls.Certificate.PrivateKey }
KeyPair implements crypto.Signer and can therefore be used as tls.Certificate.PrivateKey
func NewEd25519 ¶
type PrivateKey ¶
type PrivateKey interface { HasKey() (hasKey bool) // has key material Algo() (algo x509.PublicKeyAlgorithm) PrivateBytes() (bytes []byte) // untyped private key material }
PrivateKey does not contain public part of a key pair, only the private key
type SelfSigned ¶
type SelfSigned struct { Reader io.Reader CaDER CertificateDER // der: Distinguished Encoding Rules is a binary format KeyPair }
func (*SelfSigned) Check ¶
func (ca *SelfSigned) Check() (isValid bool, cert *x509.Certificate, err error)
func (*SelfSigned) DER ¶
func (ca *SelfSigned) DER() (bytes CertificateDER)
func (*SelfSigned) HasDER ¶
func (ca *SelfSigned) HasDER() (hasDER bool)
func (*SelfSigned) SetReader ¶
func (ca *SelfSigned) SetReader(reader io.Reader)
func (*SelfSigned) Sign ¶
func (ca *SelfSigned) Sign(template *x509.Certificate, publicKey crypto.PublicKey) (certDER CertificateDER, err error)
Click to show internal directories.
Click to hide internal directories.