Documentation
¶
Index ¶
- Variables
- type Metadata
- func (*Metadata) Descriptor() ([]byte, []int)deprecated
- func (x *Metadata) GetAfrer() int64
- func (x *Metadata) GetBefore() int64
- func (x *Metadata) GetContent() []byte
- func (x *Metadata) GetCountry() string
- func (x *Metadata) GetHash() string
- func (x *Metadata) GetLocality() string
- func (x *Metadata) GetOrganization() string
- func (x *Metadata) GetOrganizational() string
- func (x *Metadata) GetParent() []byte
- func (x *Metadata) GetPublicKey() []byte
- func (x *Metadata) GetState() string
- func (*Metadata) ProtoMessage()
- func (x *Metadata) ProtoReflect() protoreflect.Message
- func (x *Metadata) Reset()
- func (x *Metadata) String() string
- type PrivateChain
- func (*PrivateChain) Descriptor() ([]byte, []int)deprecated
- func (x *PrivateChain) GetPrivateKey() []byte
- func (x *PrivateChain) GetPublicChain() []byte
- func (*PrivateChain) ProtoMessage()
- func (x *PrivateChain) ProtoReflect() protoreflect.Message
- func (x *PrivateChain) Reset()
- func (x *PrivateChain) String() string
- type PublicChain
- func (*PublicChain) Descriptor() ([]byte, []int)deprecated
- func (x *PublicChain) GetParent() []byte
- func (x *PublicChain) GetPublicKey() *PublicKey
- func (*PublicChain) ProtoMessage()
- func (x *PublicChain) ProtoReflect() protoreflect.Message
- func (x *PublicChain) Reset()
- func (x *PublicChain) String() string
- type PublicKey
Constants ¶
This section is empty.
Variables ¶
View Source
var File_raw_raw_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct {
// 簽名使用的 hash 算法名稱
Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
// 使用此公鑰 驗證簽名,如果沒有表示它是自簽名的
Parent []byte `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"`
// 公鑰,驗證它簽名的數據是否有效
PublicKey []byte `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"`
// unix 表示此簽名有效起始時間,<1 則表示沒有此限制
Afrer int64 `protobuf:"varint,4,opt,name=afrer,proto3" json:"afrer,omitempty"`
// unix 表示此簽名有效截止時間,<1 則表示沒有此限制
Before int64 `protobuf:"varint,5,opt,name=before,proto3" json:"before,omitempty"`
// 可選的 國家名稱
Country string `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"`
// 可選的 /州 名稱
State string `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"`
// 可選的 地點或城市名稱
Locality string `protobuf:"bytes,8,opt,name=locality,proto3" json:"locality,omitempty"`
// 可選的 組織或公司名稱
Organization string `protobuf:"bytes,9,opt,name=organization,proto3" json:"organization,omitempty"`
// 可選的 組織單位或公司部門
Organizational string `protobuf:"bytes,10,opt,name=organizational,proto3" json:"organizational,omitempty"`
// 可選的 被簽名的附帶內容
Content []byte `protobuf:"bytes,11,opt,name=content,proto3" json:"content,omitempty"`
// contains filtered or unexported fields
}
簽名元信息
func (*Metadata) Descriptor
deprecated
func (*Metadata) GetContent ¶
func (*Metadata) GetCountry ¶
func (*Metadata) GetLocality ¶
func (*Metadata) GetOrganization ¶
func (*Metadata) GetOrganizational ¶
func (*Metadata) GetPublicKey ¶
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) ProtoReflect ¶
func (x *Metadata) ProtoReflect() protoreflect.Message
type PrivateChain ¶
type PrivateChain struct {
PublicChain []byte `protobuf:"bytes,1,opt,name=publicChain,proto3" json:"publicChain,omitempty"`
// 私鑰用於簽名
PrivateKey []byte `protobuf:"bytes,2,opt,name=privateKey,proto3" json:"privateKey,omitempty"`
// contains filtered or unexported fields
}
私鑰鏈,用於簽名
func (*PrivateChain) Descriptor
deprecated
func (*PrivateChain) Descriptor() ([]byte, []int)
Deprecated: Use PrivateChain.ProtoReflect.Descriptor instead.
func (*PrivateChain) GetPrivateKey ¶
func (x *PrivateChain) GetPrivateKey() []byte
func (*PrivateChain) GetPublicChain ¶
func (x *PrivateChain) GetPublicChain() []byte
func (*PrivateChain) ProtoMessage ¶
func (*PrivateChain) ProtoMessage()
func (*PrivateChain) ProtoReflect ¶
func (x *PrivateChain) ProtoReflect() protoreflect.Message
func (*PrivateChain) Reset ¶
func (x *PrivateChain) Reset()
func (*PrivateChain) String ¶
func (x *PrivateChain) String() string
type PublicChain ¶
type PublicChain struct {
// 這個鏈條是由 誰簽發的,沒有則表示自己簽名的
Parent []byte `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// 公鑰用於驗證簽名
PublicKey *PublicKey `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"`
// contains filtered or unexported fields
}
公鑰鏈,用於回溯簽發源
func (*PublicChain) Descriptor
deprecated
func (*PublicChain) Descriptor() ([]byte, []int)
Deprecated: Use PublicChain.ProtoReflect.Descriptor instead.
func (*PublicChain) GetParent ¶
func (x *PublicChain) GetParent() []byte
func (*PublicChain) GetPublicKey ¶
func (x *PublicChain) GetPublicKey() *PublicKey
func (*PublicChain) ProtoMessage ¶
func (*PublicChain) ProtoMessage()
func (*PublicChain) ProtoReflect ¶
func (x *PublicChain) ProtoReflect() protoreflect.Message
func (*PublicChain) Reset ¶
func (x *PublicChain) Reset()
func (*PublicChain) String ¶
func (x *PublicChain) String() string
type PublicKey ¶
type PublicKey struct {
// 元信息
Metadata []byte `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
// 本身的簽名用於驗證自身有效
// * 對於自己簽名的使用 metadata -> hash+publicKey 驗證
// * 否則使用 metadata -> hash+parent 進行驗證
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
// contains filtered or unexported fields
}
公鑰用於驗證簽名
func (*PublicKey) Descriptor
deprecated
func (*PublicKey) GetMetadata ¶
func (*PublicKey) GetSignature ¶
func (*PublicKey) ProtoMessage ¶
func (*PublicKey) ProtoMessage()
func (*PublicKey) ProtoReflect ¶
func (x *PublicKey) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.