Documentation
¶
Index ¶
- Constants
- func CheckCertificateAuthority(d Depot) bool
- func CheckCertificateAuthorityInfo(d Depot) bool
- func CheckCertificateHost(d Depot, name string) bool
- func CheckCertificateSigningRequest(d Depot, name string) bool
- func CheckEncryptedPrivateKeyAuthority(d Depot) bool
- func CheckEncryptedPrivateKeyHost(d Depot, name string) bool
- func CheckPrivateKeyAuthority(d Depot) bool
- func CheckPrivateKeyHost(d Depot, name string) bool
- func DeleteCertificateAuthority(d Depot) error
- func DeleteCertificateAuthorityInfo(d Depot) error
- func DeleteCertificateHost(d Depot, name string) error
- func DeleteCertificateSigningRequest(d Depot, name string) error
- func DeleteEncryptedPrivateKeyAuthority(d Depot) error
- func DeleteEncryptedPrivateKeyHost(d Depot, name string) error
- func DeletePrivateKeyAuthority(d Depot) error
- func DeletePrivateKeyHost(d Depot, name string) error
- func GetCertificateAuthority(d Depot) (crt *pkix.Certificate, err error)
- func GetCertificateAuthorityInfo(d Depot) (info *pkix.CertificateAuthorityInfo, err error)
- func GetCertificateHost(d Depot, name string) (crt *pkix.Certificate, err error)
- func GetCertificateSigningRequest(d Depot, name string) (crt *pkix.CertificateSigningRequest, err error)
- func GetEncryptedPrivateKeyAuthority(d Depot, passphrase []byte) (key *pkix.Key, err error)
- func GetEncryptedPrivateKeyHost(d Depot, name string, passphrase []byte) (key *pkix.Key, err error)
- func GetNameFromHostCrtTag(tag *Tag) string
- func GetPrivateKeyAuthority(d Depot) (key *pkix.Key, err error)
- func GetPrivateKeyHost(d Depot, name string) (key *pkix.Key, err error)
- func PutCertificateAuthority(d Depot, crt *pkix.Certificate) error
- func PutCertificateAuthorityInfo(d Depot, info *pkix.CertificateAuthorityInfo) error
- func PutCertificateHost(d Depot, name string, crt *pkix.Certificate) error
- func PutCertificateSigningRequest(d Depot, name string, csr *pkix.CertificateSigningRequest) error
- func PutEncryptedPrivateKeyAuthority(d Depot, key *pkix.Key, passphrase []byte) error
- func PutEncryptedPrivateKeyHost(d Depot, name string, key *pkix.Key, passphrase []byte) error
- func PutPrivateKeyAuthority(d Depot, key *pkix.Key) error
- func PutPrivateKeyHost(d Depot, name string, key *pkix.Key) error
- func UpdateCertificateAuthorityInfo(d Depot, info *pkix.CertificateAuthorityInfo) error
- type Depot
- type File
- type FileDepot
- type Tag
Constants ¶
View Source
const (
DefaultFileDepotDir = "certs"
)
Variables ¶
This section is empty.
Functions ¶
func CheckCertificateHost ¶
func CheckPrivateKeyHost ¶
func DeleteCertificateHost ¶
func DeletePrivateKeyHost ¶
func GetCertificateAuthority ¶
func GetCertificateAuthority(d Depot) (crt *pkix.Certificate, err error)
func GetCertificateAuthorityInfo ¶
func GetCertificateAuthorityInfo(d Depot) (info *pkix.CertificateAuthorityInfo, err error)
func GetCertificateHost ¶
func GetCertificateHost(d Depot, name string) (crt *pkix.Certificate, err error)
func GetCertificateSigningRequest ¶
func GetCertificateSigningRequest(d Depot, name string) (crt *pkix.CertificateSigningRequest, err error)
func GetNameFromHostCrtTag ¶
func PutCertificateAuthority ¶
func PutCertificateAuthority(d Depot, crt *pkix.Certificate) error
func PutCertificateAuthorityInfo ¶
func PutCertificateAuthorityInfo(d Depot, info *pkix.CertificateAuthorityInfo) error
func PutCertificateHost ¶
func PutCertificateHost(d Depot, name string, crt *pkix.Certificate) error
func PutCertificateSigningRequest ¶
func PutCertificateSigningRequest(d Depot, name string, csr *pkix.CertificateSigningRequest) error
func UpdateCertificateAuthorityInfo ¶
func UpdateCertificateAuthorityInfo(d Depot, info *pkix.CertificateAuthorityInfo) error
Types ¶
type Depot ¶
type Depot interface { Put(tag *Tag, data []byte) error Check(tag *Tag) bool Get(tag *Tag) ([]byte, error) Delete(tag *Tag) error }
Depot is in charge of data storage
type FileDepot ¶
type FileDepot struct {
// contains filtered or unexported fields
}
FileDepot is a implementation of Depot using file system
func NewFileDepot ¶
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag includes name and permission requirement Permission requirement is used in two ways: 1. Set the permission for data when Put 2. Check the permission required when Get It is set to prevent attacks from other users for FileDepot. For example, 'evil' creates file ca.key with 0666 file perm, 'core' reads it and uses it as ca.key. It may cause the security problem of fake certificate and key.
func AuthCrtInfoTag ¶
func AuthCrtInfoTag() *Tag
func AuthCrtTag ¶
func AuthCrtTag() *Tag
func AuthPrivKeyTag ¶
func AuthPrivKeyTag() *Tag
func HostCrtTag ¶
func HostCsrTag ¶
func HostPrivKeyTag ¶
Click to show internal directories.
Click to hide internal directories.