Documentation ¶
Index ¶
- func CheckPassphrase(testPrivateKey string) bool
- func DecryptData(input string) string
- func EncryptData(input string) string
- func GetConnection() *gorm.DB
- func GetPassphrase() *rsa.PrivateKey
- func GetPublicKey() *rsa.PublicKey
- func GetUserByUsername(username string, result *User)
- func HavePassphrase() bool
- func IsPassphraseSet() bool
- func SetPassphrase() string
- func SetupDatabase()
- type Certificate
- type CertificateDomain
- type CertificateVersion
- type Client
- type ClientSecret
- type TestData
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassphrase ¶
CheckPassphrase Perform decryption, using supplied private key, against DB test row and test data
func DecryptData ¶
func EncryptData ¶
func GetConnection ¶
GetConnection Return database connection singleton
func GetPassphrase ¶
func GetPassphrase() *rsa.PrivateKey
func GetPublicKey ¶
func GetUserByUsername ¶
GetUserByUsername Get user based by username
func HavePassphrase ¶
func HavePassphrase() bool
HavePassphrase Whether passphrase has been entered and is accessible for use
func IsPassphraseSet ¶
func IsPassphraseSet() bool
IsPassphraseSet Determine whether passphrase has been set
func SetPassphrase ¶
func SetPassphrase() string
SetPassphrase Generate private/public key pair, storing test data and setting cached keys
func SetupDatabase ¶
func SetupDatabase()
SetupDatabase Setupn database object and perform database migrations
Types ¶
type Certificate ¶
type Certificate struct { gorm.Model Domains []CertificateDomain `gorm:"ForeignKey:CertID"` Versions []CertificateVersion `gorm:"ForeignKey:CertID"` KeySize int }
Certificate structure for holding certificate in DB
func GetAllCertificates ¶
func GetAllCertificates() []Certificate
GetAllCertificates Get all certificates
func GetCertificateByID ¶
func GetCertificateByID(certificateID int) (Certificate, error)
func (Certificate) Delete ¶
func (cert Certificate) Delete()
Delete certificate, as well as all related objects
type CertificateDomain ¶
CertificateDomain structure for holding domain for a certificate
type CertificateVersion ¶
type CertificateVersion struct { gorm.Model PubKey string PrivKey string IssuerCertificate string Expiry time.Time CertID uint }
CertificateVersion structure for holding single issued certificate public and private key
func (CertificateVersion) Create ¶
func (certVersion CertificateVersion) Create(privKey string)
Create certificate verion
func (CertificateVersion) GetPrivateKey ¶
func (certVersion CertificateVersion) GetPrivateKey() string
type ClientSecret ¶
ClientSecret struct, representing client secret DB table