Documentation ¶
Index ¶
Constants ¶
const CertificateV1Type = certifyNs + "/CertificateV1"
Default type values for each interface implementation.
const MsgCreateCertificateType = certifyNs + "/MsgCreateCertificate"
const MsgCreateSecretType = certifyNs + "/MsgCreateSecret"
const SecretV1Type = certifyNs + "/SecretV1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
Certificate sets the default methods a real certificate must implement.
type CertificateV1 ¶
type CertificateV1 struct { Uuid string `json:"uuid"` CompanyChainID string `json:"company_chain_id"` Seal *dataSeal `json:"seal"` }
CertificateV1 is the first version of a certificate to send in a transaction's message. It should implement the Certificate interface.
func NewCertificateV1 ¶
func NewCertificateV1(uuid string, companyChainID string, dataSignature []byte, dataSigner []byte) *CertificateV1
CertificateV1 constructor.
func (CertificateV1) GetCompanyChainID ¶
func (c CertificateV1) GetCompanyChainID() string
GetCompanyChainID returns the company chain id value (Certificate interface requirement).
func (CertificateV1) GetType ¶
func (c CertificateV1) GetType() string
GetType returns the type value (Certificate interface requirement).
func (CertificateV1) GetUuid ¶
func (c CertificateV1) GetUuid() string
GetUuid returns the uuid value (Certificate interface requirement).
func (CertificateV1) MarshalJSON ¶
func (c CertificateV1) MarshalJSON() ([]byte, error)
MarshalJSON converts a CertificateV1 into a jsonCertificateV1 and wraps it in a JSONWrapper to indicate which version of a certificate should be unmarshaled back.
type MsgCreateCertificate ¶
type MsgCreateCertificate struct {
Certificate Certificate `json:"certificate"`
}
MsgCreateCertificate is a wrapper to indicate that a create certificate action should be applied in a transaction. It should implement the Message interface.
func (MsgCreateCertificate) GetType ¶
func (mcc MsgCreateCertificate) GetType() string
GetType returns the type value (Message interface requirement).
func (MsgCreateCertificate) MarshalJSON ¶ added in v1.1.0
func (mcc MsgCreateCertificate) MarshalJSON() ([]byte, error)
MarshalJSON converts a MsgCreateCertificate into a jsonMsgCreateCertificate and wraps it in a JSONWrapper to indicate which message action and message value should be unmarshaled back.
func (*MsgCreateCertificate) UnmarshalJSON ¶ added in v1.1.0
func (mcc *MsgCreateCertificate) UnmarshalJSON(data []byte) error
UnmarshalJSON converts an already unwrapped json value to a MsgCreateCertificate. It handles the Certificate interface conversion as well.
type MsgCreateSecret ¶ added in v1.1.0
type MsgCreateSecret struct {
Secret Secret `json:"secret"`
}
MsgCreateSecret is a wrapper to indicate that a create secret action should be applied in a transaction. It should implement the Message interface.
func (MsgCreateSecret) GetType ¶ added in v1.1.0
func (mcc MsgCreateSecret) GetType() string
GetType returns the type value (Message interface requirement).
func (MsgCreateSecret) MarshalJSON ¶ added in v1.1.0
func (mcc MsgCreateSecret) MarshalJSON() ([]byte, error)
MarshalJSON converts a MsgCreateSecret into a jsonMsgCreateSecret and wraps it in a JSONWrapper to indicate which message action and message value should be unmarshaled back.
func (*MsgCreateSecret) UnmarshalJSON ¶ added in v1.1.0
func (mcc *MsgCreateSecret) UnmarshalJSON(data []byte) error
UnmarshalJSON converts an already unwrapped json value to a MsgCreateSecret. It handles the Secret interface conversion as well.
type SecretV1 ¶ added in v1.1.0
type SecretV1 struct { CertificateUuid string `json:"certificate_uuid"` CompanyChainID string `json:"company_chain_id"` Lock *lock `json:"lock"` }
SecretV1 is the first version of a secret to send in a transaction's message. It should implement the Secret interface.
func NewSecretV1 ¶ added in v1.1.0
func NewSecretV1( certificateUuid string, companyChainID string, lockEncryptor *X25519.PublicKey, lockNonce *X25519.NaclBoxNonce, lockContent []byte, ) *SecretV1
SecretV1 constructor.
func (SecretV1) GetCertificateUuid ¶ added in v1.1.0
GetCertificateUuid returns the certificate uuid value (Secret interface requirement).
func (SecretV1) GetCompanyChainID ¶ added in v1.1.0
GetCompanyChainID returns the company chain id value (Secret interface requirement).
func (SecretV1) GetType ¶ added in v1.1.0
GetType returns the type value (Secret interface requirement).
func (SecretV1) MarshalJSON ¶ added in v1.1.0
MarshalJSON converts a SecretV1 into a jsonSecretV1 and wraps it in a JSONWrapper to indicate which version of a secret should be unmarshaled back.