Documentation ¶
Index ¶
- Constants
- func CodecHandle() *codec.MsgpackHandle
- func ComputeSigIDFromSigBody(body []byte) keybase1.SigID
- func DecodePacket(decoder *codec.Decoder, body Packetable) error
- func DecodePacketFromBytes(data []byte, body Packetable) error
- func EncodePacket(p Packetable, encoder *codec.Encoder) error
- func EncodePacketToArmoredString(p Packetable) (string, error)
- func EncodePacketToBytes(p Packetable) ([]byte, error)
- func FastByteArrayEq(a, b []byte) bool
- func SecureByteArrayEq(a, b []byte) bool
- type AlgoType
- type BadKeyError
- type BadSignaturePrefixError
- type FishyMsgpackError
- type HashType
- type NaclSigInfo
- type NaclSignature
- type NaclSigningKeyPrivate
- func (k NaclSigningKeyPrivate) Sign(msg []byte) NaclSignature
- func (k NaclSigningKeyPrivate) SignInfoV0(msg []byte, public NaclSigningKeyPublic) NaclSigInfo
- func (k NaclSigningKeyPrivate) SignInfoV2(msg []byte, public NaclSigningKeyPublic, prefix SignaturePrefix) (NaclSigInfo, error)
- func (k NaclSigningKeyPrivate) SignToStringV0(msg []byte, public NaclSigningKeyPublic) (string, keybase1.SigID, error)
- type NaclSigningKeyPublic
- type PacketTag
- type PacketVersion
- type Packetable
- type SignaturePrefix
- type UnhandledSignatureError
- type UnmarshalError
- type VerificationError
Constants ¶
View Source
const (
IDSuffixKID = 0x0a
)
View Source
const (
KeybaseKIDV1 = 1 // Uses SHA-256
)
View Source
const (
SCSigCannotVerify = int(keybase1.StatusCode_SCSigCannotVerify)
)
View Source
const SHA256Code = 8
Variables ¶
This section is empty.
Functions ¶
func CodecHandle ¶
func CodecHandle() *codec.MsgpackHandle
func ComputeSigIDFromSigBody ¶
func DecodePacket ¶
func DecodePacket(decoder *codec.Decoder, body Packetable) error
func DecodePacketFromBytes ¶
func DecodePacketFromBytes(data []byte, body Packetable) error
func EncodePacket ¶
func EncodePacket(p Packetable, encoder *codec.Encoder) error
func EncodePacketToArmoredString ¶
func EncodePacketToArmoredString(p Packetable) (string, error)
func EncodePacketToBytes ¶
func EncodePacketToBytes(p Packetable) ([]byte, error)
func FastByteArrayEq ¶
func SecureByteArrayEq ¶
Types ¶
type BadKeyError ¶
type BadKeyError struct {
Msg string
}
func (BadKeyError) Error ¶
func (p BadKeyError) Error() string
type BadSignaturePrefixError ¶
type BadSignaturePrefixError struct{}
func (BadSignaturePrefixError) Error ¶
func (e BadSignaturePrefixError) Error() string
type FishyMsgpackError ¶
type FishyMsgpackError struct {
// contains filtered or unexported fields
}
func (FishyMsgpackError) Error ¶
func (e FishyMsgpackError) Error() string
type NaclSigInfo ¶
type NaclSigInfo struct { Kid keybase1.BinaryKID `codec:"key"` Payload []byte `codec:"payload,omitempty"` Sig NaclSignature `codec:"sig"` SigType AlgoType `codec:"sig_type"` HashType HashType `codec:"hash_type"` Detached bool `codec:"detached"` Version int `codec:"version,omitempty"` Prefix SignaturePrefix `codec:"prefix,omitempty"` }
func DecodeArmoredNaclSigInfoPacket ¶
func DecodeArmoredNaclSigInfoPacket(s string) (NaclSigInfo, error)
func DecodeNaclSigInfoPacket ¶
func DecodeNaclSigInfoPacket(data []byte) (NaclSigInfo, error)
func (*NaclSigInfo) ArmoredEncode ¶
func (s *NaclSigInfo) ArmoredEncode() (ret string, err error)
func (*NaclSigInfo) GetTagAndVersion ¶
func (s *NaclSigInfo) GetTagAndVersion() (PacketTag, PacketVersion)
func (NaclSigInfo) Verify ¶
func (s NaclSigInfo) Verify() (*NaclSigningKeyPublic, error)
type NaclSignature ¶
type NaclSignature [ed25519.SignatureSize]byte
type NaclSigningKeyPrivate ¶
type NaclSigningKeyPrivate [ed25519.PrivateKeySize]byte
func (NaclSigningKeyPrivate) Sign ¶
func (k NaclSigningKeyPrivate) Sign(msg []byte) NaclSignature
func (NaclSigningKeyPrivate) SignInfoV0 ¶
func (k NaclSigningKeyPrivate) SignInfoV0(msg []byte, public NaclSigningKeyPublic) NaclSigInfo
func (NaclSigningKeyPrivate) SignInfoV2 ¶
func (k NaclSigningKeyPrivate) SignInfoV2(msg []byte, public NaclSigningKeyPublic, prefix SignaturePrefix) (NaclSigInfo, error)
func (NaclSigningKeyPrivate) SignToStringV0 ¶
func (k NaclSigningKeyPrivate) SignToStringV0(msg []byte, public NaclSigningKeyPublic) (string, keybase1.SigID, error)
type NaclSigningKeyPublic ¶
type NaclSigningKeyPublic [ed25519.PublicKeySize]byte
func KIDToNaclSigningKeyPublic ¶
func KIDToNaclSigningKeyPublic(bk []byte) *NaclSigningKeyPublic
func NaclVerifyAndExtract ¶
func NaclVerifyAndExtract(s string) (nk *NaclSigningKeyPublic, payload []byte, fullBody []byte, err error)
NaclVerifyAndExtract interprets the given string as a NaCl-signed messaged, in the keybase NaclSigInfo (v1) format. It will check that the signature verified, and if so, will return the public key that was used for the verification, the payload of the signature, the full body of the decoded SignInfo, and an error
func NaclVerifyWithPayload ¶
func NaclVerifyWithPayload(sig string, payloadIn []byte) (nk *NaclSigningKeyPublic, fullBody []byte, err error)
func (NaclSigningKeyPublic) GetBinaryKID ¶
func (k NaclSigningKeyPublic) GetBinaryKID() keybase1.BinaryKID
func (NaclSigningKeyPublic) GetKID ¶
func (k NaclSigningKeyPublic) GetKID() keybase1.KID
func (NaclSigningKeyPublic) Verify ¶
func (k NaclSigningKeyPublic) Verify(msg []byte, sig NaclSignature) bool
type PacketTag ¶
type PacketTag uint
PacketTag are tags for OpenPGP and Keybase packets. It is a uint to be backwards compatible with older versions of codec that encoded positive ints as uints.
type Packetable ¶
type Packetable interface {
GetTagAndVersion() (PacketTag, PacketVersion)
}
type SignaturePrefix ¶
type SignaturePrefix string
const ( SignaturePrefixKBFS SignaturePrefix = "Keybase-KBFS-1" SignaturePrefixSigchain SignaturePrefix = "Keybase-Sigchain-1" SignaturePrefixSigchain3 SignaturePrefix = "Keybase-Sigchain-3" SignaturePrefixChatAttachment SignaturePrefix = "Keybase-Chat-Attachment-1" SignaturePrefixNIST SignaturePrefix = "Keybase-Auth-NIST-1" // Chat prefixes for each MessageBoxedVersion. SignaturePrefixChatMBv1 SignaturePrefix = "Keybase-Chat-1" SignaturePrefixChatMBv2 SignaturePrefix = "Keybase-Chat-2" )
const (
SignaturePrefixTesting SignaturePrefix = "Keybase-Testing-1"
)
func (SignaturePrefix) HasNullByte ¶
func (p SignaturePrefix) HasNullByte() bool
func (SignaturePrefix) IsWhitelisted ¶
func (p SignaturePrefix) IsWhitelisted() bool
func (SignaturePrefix) IsWhitelistedTest ¶
func (p SignaturePrefix) IsWhitelistedTest() bool
func (SignaturePrefix) Prefix ¶
func (p SignaturePrefix) Prefix(msg []byte) []byte
type UnhandledSignatureError ¶
type UnhandledSignatureError struct {
// contains filtered or unexported fields
}
func (UnhandledSignatureError) Error ¶
func (e UnhandledSignatureError) Error() string
type UnmarshalError ¶
func (UnmarshalError) Error ¶
func (u UnmarshalError) Error() string
type VerificationError ¶
type VerificationError struct { // XXX - NOTE(maxtaco) - 20190418 - this is not to be confused with Cause(), which interacts with the pkg/errors // system. There should probably be a better solution than this, but let's leave it for now. Cause error }
func NewVerificationError ¶
func NewVerificationError(e error) VerificationError
func (VerificationError) Error ¶
func (e VerificationError) Error() string
func (VerificationError) ToStatus ¶
func (e VerificationError) ToStatus() keybase1.Status
Click to show internal directories.
Click to hide internal directories.