Documentation ¶
Overview ¶
Package crypto is a generated protocol buffer package.
It is generated from these files:
crypto/models.proto
It has these top-level messages:
PublicKey PrivateKey Signature
Index ¶
- Constants
- Variables
- type PrivateKey
- func (*PrivateKey) Descriptor() ([]byte, []int)
- func (m *PrivateKey) GetEd25519() []byte
- func (m *PrivateKey) GetPriv() isPrivateKey_Priv
- func (m *PrivateKey) Marshal() (dAtA []byte, err error)
- func (m *PrivateKey) MarshalTo(dAtA []byte) (int, error)
- func (*PrivateKey) ProtoMessage()
- func (p *PrivateKey) PublicKey() *PublicKey
- func (m *PrivateKey) Reset()
- func (p *PrivateKey) Sign(message []byte) (*Signature, error)
- func (m *PrivateKey) Size() (n int)
- func (m *PrivateKey) String() string
- func (m *PrivateKey) Unmarshal(dAtA []byte) error
- func (*PrivateKey) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type PrivateKey_Ed25519
- type PubKey
- type PublicKey
- func (p *PublicKey) Address() weave.Address
- func (p *PublicKey) Condition() weave.Condition
- func (*PublicKey) Descriptor() ([]byte, []int)
- func (m *PublicKey) GetEd25519() []byte
- func (m *PublicKey) GetPub() isPublicKey_Pub
- func (m *PublicKey) Marshal() (dAtA []byte, err error)
- func (m *PublicKey) MarshalTo(dAtA []byte) (int, error)
- func (*PublicKey) ProtoMessage()
- func (m *PublicKey) Reset()
- func (m *PublicKey) Size() (n int)
- func (m *PublicKey) String() string
- func (m *PublicKey) Unmarshal(dAtA []byte) error
- func (p *PublicKey) Verify(message []byte, sig *Signature) bool
- func (*PublicKey) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type PublicKey_Ed25519
- type Signature
- func (*Signature) Descriptor() ([]byte, []int)
- func (m *Signature) GetEd25519() []byte
- func (m *Signature) GetSig() isSignature_Sig
- func (m *Signature) Marshal() (dAtA []byte, err error)
- func (m *Signature) MarshalTo(dAtA []byte) (int, error)
- func (*Signature) ProtoMessage()
- func (m *Signature) Reset()
- func (m *Signature) Size() (n int)
- func (m *Signature) String() string
- func (m *Signature) Unmarshal(dAtA []byte) error
- func (*Signature) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type Signature_Ed25519
- type Signer
Constants ¶
const ExtensionName = "sigs"
ExtensionName is used for the Conditions we get from signatures
Variables ¶
var ( ErrInvalidLengthModels = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowModels = fmt.Errorf("proto: integer overflow") )
Functions ¶
This section is empty.
Types ¶
type PrivateKey ¶
type PrivateKey struct { // Types that are valid to be assigned to Priv: // *PrivateKey_Ed25519 Priv isPrivateKey_Priv `protobuf_oneof:"priv"` }
func GenPrivKeyEd25519 ¶
func GenPrivKeyEd25519() *PrivateKey
GenPrivKeyEd25519 returns a random new private key (TODO: look at sources of randomness, other than default crypto/rand)
func (*PrivateKey) Descriptor ¶
func (*PrivateKey) Descriptor() ([]byte, []int)
func (*PrivateKey) GetEd25519 ¶
func (m *PrivateKey) GetEd25519() []byte
func (*PrivateKey) GetPriv ¶
func (m *PrivateKey) GetPriv() isPrivateKey_Priv
func (*PrivateKey) Marshal ¶
func (m *PrivateKey) Marshal() (dAtA []byte, err error)
func (*PrivateKey) ProtoMessage ¶
func (*PrivateKey) ProtoMessage()
func (*PrivateKey) PublicKey ¶
func (p *PrivateKey) PublicKey() *PublicKey
PublicKey returns the corresponding PublicKey
func (*PrivateKey) Reset ¶
func (m *PrivateKey) Reset()
func (*PrivateKey) Sign ¶
func (p *PrivateKey) Sign(message []byte) (*Signature, error)
Sign returns a matching signature for this private key
func (*PrivateKey) Size ¶
func (m *PrivateKey) Size() (n int)
func (*PrivateKey) String ¶
func (m *PrivateKey) String() string
func (*PrivateKey) Unmarshal ¶
func (m *PrivateKey) Unmarshal(dAtA []byte) error
func (*PrivateKey) XXX_OneofFuncs ¶
func (*PrivateKey) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
type PrivateKey_Ed25519 ¶
type PrivateKey_Ed25519 struct {
Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof"`
}
func (*PrivateKey_Ed25519) MarshalTo ¶
func (m *PrivateKey_Ed25519) MarshalTo(dAtA []byte) (int, error)
func (*PrivateKey_Ed25519) PublicKey ¶
func (p *PrivateKey_Ed25519) PublicKey() *PublicKey
PublicKey returns the corresponding PublicKey
func (*PrivateKey_Ed25519) Sign ¶
func (p *PrivateKey_Ed25519) Sign(message []byte) (*Signature, error)
Sign returns a matching signature for this private key
func (*PrivateKey_Ed25519) Size ¶
func (m *PrivateKey_Ed25519) Size() (n int)
type PublicKey ¶
type PublicKey struct { // Types that are valid to be assigned to Pub: // *PublicKey_Ed25519 Pub isPublicKey_Pub `protobuf_oneof:"pub"` }
func (*PublicKey) Condition ¶ added in v0.4.0
Condition generates a Condition object to represent a valid signature.
func (*PublicKey) Descriptor ¶
func (*PublicKey) GetEd25519 ¶
func (*PublicKey) ProtoMessage ¶
func (*PublicKey) ProtoMessage()
type PublicKey_Ed25519 ¶
type PublicKey_Ed25519 struct {
Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof"`
}
func (*PublicKey_Ed25519) Condition ¶ added in v0.4.0
func (p *PublicKey_Ed25519) Condition() weave.Condition
Condition encodes the public key into a weave permission
func (*PublicKey_Ed25519) MarshalTo ¶
func (m *PublicKey_Ed25519) MarshalTo(dAtA []byte) (int, error)
func (*PublicKey_Ed25519) Size ¶
func (m *PublicKey_Ed25519) Size() (n int)
type Signature ¶
type Signature struct { // Types that are valid to be assigned to Sig: // *Signature_Ed25519 Sig isSignature_Sig `protobuf_oneof:"sig"` }
func (*Signature) Descriptor ¶
func (*Signature) GetEd25519 ¶
func (*Signature) ProtoMessage ¶
func (*Signature) ProtoMessage()
type Signature_Ed25519 ¶
type Signature_Ed25519 struct {
Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof"`
}
func (*Signature_Ed25519) MarshalTo ¶
func (m *Signature_Ed25519) MarshalTo(dAtA []byte) (int, error)
func (*Signature_Ed25519) Size ¶
func (m *Signature_Ed25519) Size() (n int)