Documentation
¶
Index ¶
Constants ¶
View Source
const ( //CERT_CONTENT_NAME table name CERT_CONTENT_NAME = "cert_content" //CERT_INFO_NAME table name CERT_INFO_NAME = "cert_info" //KEY_PAIR_NAME table name KEY_PAIR_NAME = "key_pair" //REVOKED_CERT_NAME table name REVOKED_CERT_NAME = "revoked_cert" //ACCESS_CONTROL table name ACCESS_CONTROL = "app_info" )
Variables ¶
View Source
var AccessRole2NameMap = map[AccessRole]string{ ADMIN: "admin", USER: "user", }
AccessRole2NameMap .
View Source
var CertUsage2NameMap = map[CertUsage]string{ SIGN: "sign", TLS: "tls", TLS_SIGN: "tls-sign", TLS_ENC: "tls-enc", }
CertUsage2NameMap .
DB database
View Source
var Name2AccessRoleMap = map[string]AccessRole{ "admin": ADMIN, "user": USER, }
Name2AccessRoleMap .
View Source
var Name2CertUsageMap = map[string]CertUsage{ "sign": SIGN, "tls": TLS, "tls-sign": TLS_SIGN, "tls-enc": TLS_ENC, }
Name2CertUsageMap .
View Source
var Name2UserTypeMap = map[string]UserType{ "root": ROOT_CA, "ca": INTERMRDIARY_CA, "admin": USER_ADMIN, "client": USER_CLIENT, "consensus": NODE_CONSENSUS, "common": NODE_COMMON, }
Name2UserTypeMap string name to cert type
View Source
var UserType2NameMap = map[UserType]string{ ROOT_CA: "root", INTERMRDIARY_CA: "ca", USER_ADMIN: "admin", USER_CLIENT: "client", NODE_CONSENSUS: "consensus", NODE_COMMON: "common", }
UserType2NameMap CertType to string name
Functions ¶
Types ¶
type AccessRole ¶
type AccessRole int
const ( //ADMIN admin ADMIN AccessRole = iota + 1 //USER user USER )
type AppInfo ¶
type AppInfo struct {
TableModel
AppId string `gorm:"uniqueIndex"`
AppKey string
AppRole AccessRole
}
type CertContent ¶
type CertContent struct {
TableModel
SerialNumber int64 `gorm:"uniqueIndex"`
Content string `gorm:"type:longtext"`
Signature string `gorm:"type:longtext"`
Country string
Locality string
Province string
Organization string
OrganizationalUnit string
CommonName string
Ski string
Aki string
KeyUsage int
ExtKeyUsage string
CsrContent string `gorm:"type:longtext"`
IsCa bool
IssueDate int64
ExpirationDate int64
}
CertContent The initiatively populated field in the program & the final generated certificate file
type CertInfo ¶
type CertInfo struct {
TableModel
SerialNumber int64
PrivateKeyId string
IssuerSn int64
P2pNodeId string
OrgId string `gorm:"index: orgid_usertype_certusage_userid_index,unique"`
UserType UserType `gorm:"index: orgid_usertype_certusage_userid_index,unique"`
CertUsage CertUsage `gorm:"index: orgid_usertype_certusage_userid_index,unique"`
UserId string `gorm:"index: orgid_usertype_certusage_userid_index,unique"`
}
CertInfo Other relevant information
type KeyPair ¶
type KeyPair struct {
TableModel
Ski string `gorm:"uniqueIndex"`
PrivateKey string `gorm:"type:longtext"`
PublicKey string `gorm:"type:longtext"`
HashType crypto.HashType
KeyType crypto.KeyType
}
KeyPair public/private key pair informations
type RevokedCert ¶
type RevokedCert struct {
TableModel
RevokedCertSN int64 `gorm:"uniqueIndex"`
Reason string
RevokedStartTime int64
RevokedEndTime int64
RevokedBy int64
OrgId string
}
RevokedCert revoked cert
func (*RevokedCert) TableName ¶
func (*RevokedCert) TableName() string
type TableModel ¶
Source Files
¶
- common.go
- db.go
- table.go
Click to show internal directories.
Click to hide internal directories.