Documentation ¶
Overview ¶
The keys module containing the keys CRUD operation and relationship CRUD
model.go: definition of orm based data model
routers.go: router binding and core logic
serializers.go: definition the schema of return data
validators.go: definition the validator of form data
Index ¶
- Constants
- func DecryptData(c *gin.Context)
- func DeleteAESKeyModel(condition interface{}) error
- func DeleteKeyModel(condition interface{}) error
- func EncryptData(c *gin.Context)
- func KeyCreate(c *gin.Context)
- func KeyDelete(c *gin.Context)
- func KeyList(c *gin.Context)
- func KeyRetrieve(c *gin.Context)
- func KeyRotate(c *gin.Context)
- func KeyUpdate(c *gin.Context)
- func KeysOperationsRegister(router *gin.RouterGroup)
- func KeysRegister(router *gin.RouterGroup)
- func RewrapData(c *gin.Context)
- func SaveOne(data interface{}) error
- type AESKey
- type AESKeyModel
- type AESPayload
- type DecryptDataResponse
- type DecryptDataSerializer
- type DecryptDataValidator
- type EncryptDataResponse
- type EncryptDataSerializer
- type EncryptDataValidator
- type KeyModel
- type KeyModelValidator
- type KeyResponse
- type KeySerializer
- type KeyType
- type KeysResponse
- type KeysSerializer
Constants ¶
View Source
const ( AES_KEY_SIZE_128 = 16 AES_KEY_SIZE_192 = 24 AES_KEY_SIZE_256 = 32 )
Variables ¶
This section is empty.
Functions ¶
func DecryptData ¶
func DeleteAESKeyModel ¶
func DeleteAESKeyModel(condition interface{}) error
func DeleteKeyModel ¶
func DeleteKeyModel(condition interface{}) error
func EncryptData ¶
func KeyRetrieve ¶
func KeysOperationsRegister ¶
func KeysOperationsRegister(router *gin.RouterGroup)
func KeysRegister ¶
func KeysRegister(router *gin.RouterGroup)
func RewrapData ¶
Types ¶
type AESKeyModel ¶
type AESPayload ¶
type DecryptDataResponse ¶
type DecryptDataResponse struct {
Plaintext string `json:"plaintext"`
}
type DecryptDataSerializer ¶
type DecryptDataSerializer struct { C *gin.Context AESPayload }
func (*DecryptDataSerializer) Response ¶
func (s *DecryptDataSerializer) Response() DecryptDataResponse
type DecryptDataValidator ¶
type DecryptDataValidator struct { Ciphertext string `json:"ciphertext"` // contains filtered or unexported fields }
func NewDecryptDataValidator ¶
func NewDecryptDataValidator() DecryptDataValidator
type EncryptDataResponse ¶
type EncryptDataSerializer ¶
type EncryptDataSerializer struct { C *gin.Context AESPayload }
func (*EncryptDataSerializer) Response ¶
func (s *EncryptDataSerializer) Response() EncryptDataResponse
type EncryptDataValidator ¶
type EncryptDataValidator struct { Plaintext string `json:"plaintext"` // contains filtered or unexported fields }
func NewEncryptDataValidator ¶
func NewEncryptDataValidator() EncryptDataValidator
func NewEncryptDataValidatorFillWith ¶
func NewEncryptDataValidatorFillWith(aesPayload AESPayload) EncryptDataValidator
func (*EncryptDataValidator) Validate ¶
func (s *EncryptDataValidator) Validate() error
type KeyModel ¶
type KeyModel struct { gorm.Model KeyID uint Name string Type KeyType Keys []AESKeyModel `gorm:"foreignKey:KeyID;constraint:OnDelete:CASCADE;"` AllowPlaintextBackup bool AutoRotatePeriod int DeletionAllowed bool Derived bool Exportable bool ImportedKey bool LatestVersion int MinAvailableVersion int MinDecryptionVersion int MinEncryptionVersion int SupportsDecryption bool SupportsDerivation bool SupportsEncryption bool SupportsSigning bool }
func FindManyKeys ¶
func FindOneKey ¶
type KeyModelValidator ¶
type KeyModelValidator struct { AllowPlaintextBackup bool `json:"allow_plaintext_backup"` AutoRotatePeriod string `json:"auto_rotate_period"` DeletionAllowed string `json:"deletion_allowed"` Derived string `json:"derived"` Exportable string `json:"exportable"` MinDecryptionVersion string `json:"min_decryption_version"` MinEncryptionVersion string `json:"min_encryption_version"` Name string `json:"-"` Type KeyType `json:"type"` // contains filtered or unexported fields }
func NewKeyModelValidator ¶
func NewKeyModelValidator() KeyModelValidator
func NewKeyModelValidatorFillWith ¶
func NewKeyModelValidatorFillWith(keyModel KeyModel) KeyModelValidator
type KeyResponse ¶
type KeyResponse struct { AllowPlaintextBackup bool `json:"allow_plaintext_backup"` AutoRotatePeriod int `json:"auto_rotate_period"` DeletionAllowed bool `json:"deletion_allowed"` Derived bool `json:"derived"` Exportable bool `json:"exportable"` ImportedKey bool `json:"imported_key"` LatestVersion int `json:"latest_version"` MinAvailableVersion int `json:"min_available_version"` MinDecryptionVersion int `json:"min_decryption_version"` MinEncryptionVersion int `json:"min_encryption_version"` Name string `json:"name"` SupportsDecryption bool `json:"supports_decryption"` SupportsDerivation bool `json:"supports_derivation"` SupportsEncryption bool `json:"supports_encryption"` SupportsSigning bool `json:"supports_signing"` Type KeyType `json:"type"` Keys map[int]int `json:"keys"` }
type KeySerializer ¶
func (*KeySerializer) Response ¶
func (s *KeySerializer) Response() KeyResponse
type KeysResponse ¶
type KeysResponse struct {
Keys []string `json:"keys"`
}
type KeysSerializer ¶
func (*KeysSerializer) Response ¶
func (s *KeysSerializer) Response() KeysResponse
Click to show internal directories.
Click to hide internal directories.