certify

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const CertificateV1Type = certifyNs + "/CertificateV1"

Default type values for each interface implementation.

View Source
const MsgCreateCertificateType = certifyNs + "/MsgCreateCertificate"
View Source
const MsgCreateSecretType = certifyNs + "/MsgCreateSecret"
View Source
const SecretV1Type = certifyNs + "/SecretV1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate interface {
	GetUuid() string
	GetCompanyChainID() string
	GetType() string
}

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 Secret added in v1.1.0

type Secret interface {
	GetCertificateUuid() string
	GetCompanyChainID() string
	GetType() string
}

Secret sets the default methods a real secret must implement.

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

func (c SecretV1) GetCertificateUuid() string

GetCertificateUuid returns the certificate uuid value (Secret interface requirement).

func (SecretV1) GetCompanyChainID added in v1.1.0

func (c SecretV1) GetCompanyChainID() string

GetCompanyChainID returns the company chain id value (Secret interface requirement).

func (SecretV1) GetType added in v1.1.0

func (c SecretV1) GetType() string

GetType returns the type value (Secret interface requirement).

func (SecretV1) MarshalJSON added in v1.1.0

func (c SecretV1) MarshalJSON() ([]byte, error)

MarshalJSON converts a SecretV1 into a jsonSecretV1 and wraps it in a JSONWrapper to indicate which version of a secret should be unmarshaled back.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL