cryptoconditions

package
v0.0.0-...-f90fec7 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FeatureBitmask_SHA256    int = 0x01
	FeatureBitmask_PREIMAGE  int = 0x02
	FeatureBitmask_PREFIX    int = 0x04
	FeatureBitmask_THRESHOLD int = 0x08
	FeatureBitmask_RSA_PSS   int = 0x10
	FeatureBitmask_ED25519   int = 0x20
)
View Source
const (
	VERSION       = "0.5.1"
	SHORT_VERSION = "0.5"
)

Variables

This section is empty.

Functions

func GenerateKeypair

func GenerateKeypair() (string, string)

Returns a pair of (private_key, public_key) encoded in base58.

Types

type ConditionASCII

type ConditionASCII []struct {
	Type                 ConditionType `json:"type"`
	FeatureBitmask       []byte        `json:"bitmask"`
	Fingerprint          []byte        `json:"public_key"`
	MaxFulfillmentLength int64         `json:"maxFulfillmentLength"`
}

func (*ConditionASCII) String

func (cc *ConditionASCII) String() string

type ConditionASN1

type ConditionASN1 []struct {
	Type           ConditionType `asn1:"type"`
	FeatureBitmask asn1.RawValue `asn1:"featureBitmask"`
	// Fingerprint is the public key
	Fingerprint          asn1.RawValue `asn1:"fingerprint"`
	MaxFulfillmentLength int64         `asn1:"maxFulfillmentLength"`
}

type ConditionType

type ConditionType int
const (
	PREIMAGE_SHA256 ConditionType = iota
	RSA_SHA256
	PREFIX_SHA256
	THRESHOLD_SHA256
	ED25519
)

type Ed25519FingerprintASCII

type Ed25519FingerprintASCII []byte // (SIZE(32)) -- publicKey

type Ed25519FingerprintASN1

type Ed25519FingerprintASN1 asn1.RawValue // (SIZE(32)) -- publicKey

type Ed25519FulfillmentPayloadASCII

type Ed25519FulfillmentPayloadASCII []struct {
	PublicKey []byte `json:"publicKey"` //(SIZE(32)), TODO
	Signature []byte `json:"signature"` // (SIZE(64)) TODO
}

type Ed25519FulfillmentPayloadASN1

type Ed25519FulfillmentPayloadASN1 []struct {
	PublicKey asn1.RawValue `asn1:"publicKey"` //(SIZE(32)), TODO
	Signature asn1.RawValue `asn1:"signature"` // (SIZE(64)) TODO
}

type FulfillmentASCII

type FulfillmentASCII []struct {
	Type    ConditionASCII `json:"type"`
	Payload []byte         `json:"payload"`
}

func (*FulfillmentASCII) String

func (cf *FulfillmentASCII) String() string

type FulfillmentASN1

type FulfillmentASN1 []struct {
	Type    ConditionASN1 `asn1:"type"`
	Payload asn1.RawValue `asn1:"payload"`
}

type PrefixSha256FingerprintContentsASCII

type PrefixSha256FingerprintContentsASCII []struct {
	Prefix    []byte         `json:"prefix"`
	Condition ConditionASCII `json:"condition"`
}

type PrefixSha256FingerprintContentsASN1

type PrefixSha256FingerprintContentsASN1 []struct {
	Prefix    asn1.RawValue `asn1:"prefix"`
	Condition ConditionASN1 `asn1:"condition"`
}

type PrefixSha256FulfillmentPayloadASCII

type PrefixSha256FulfillmentPayloadASCII []struct {
	Prefix         []byte           `json:"prefix"`
	Subfulfillment FulfillmentASCII `json:"subfulfillment"`
}

type PrefixSha256FulfillmentPayloadASN1

type PrefixSha256FulfillmentPayloadASN1 []struct {
	Prefix         asn1.RawValue   `asn1:"prefix"`
	Subfulfillment FulfillmentASN1 `asn1:"subfulfillment"`
}

type RsaSha256FingerprintContentsASCII

type RsaSha256FingerprintContentsASCII int64

type RsaSha256FingerprintContentsASN1

type RsaSha256FingerprintContentsASN1 int64

type RsaSha256FulfillmentPayloadASCII

type RsaSha256FulfillmentPayloadASCII []struct {
	Modulus   []byte `json:"modulus"`   // (SIZE(128..512)), TODO
	Signature []byte `json:"signature"` // (SIZE(128..512)) TODO
}

type RsaSha256FulfillmentPayloadASN1

type RsaSha256FulfillmentPayloadASN1 []struct {
	Modulus   asn1.RawValue `asn1:"modulus"`   // (SIZE(128..512)), TODO
	Signature asn1.RawValue `asn1:"signature"` // (SIZE(128..512)) TODO
}

type Sha256FingerprintASCII

type Sha256FingerprintASCII []byte // (SIZE(32)) -- digest TODO

type Sha256FingerprintASN1

type Sha256FingerprintASN1 asn1.RawValue // (SIZE(32)) -- digest TODO

type ThresholdSha256FingerprintContentsASCII

type ThresholdSha256FingerprintContentsASCII []struct {
	Threshold     int32                        `json:"threshold"`
	Subconditions []ThresholdSubconditionASCII `json:"subconditions"`
}

type ThresholdSha256FingerprintContentsASN1

type ThresholdSha256FingerprintContentsASN1 []struct {
	Threshold     int32                       `asn1:"threshold"`
	Subconditions []ThresholdSubconditionASN1 `asn1:"subconditions"`
}

type ThresholdSha256FulfillmentPayloadASCII

type ThresholdSha256FulfillmentPayloadASCII []struct {
	Threshold       int32                          `json:"threshold"`
	Subfulfillments []ThresholdSubfulfillmentASCII `json:"subfulfillments"`
}

type ThresholdSha256FulfillmentPayloadASN1

type ThresholdSha256FulfillmentPayloadASN1 []struct {
	Subfulfillments []ThresholdSubfulfillmentASN1 `asn1:"subfulfillments"`
	// contains filtered or unexported fields
}

type ThresholdSubconditionASCII

type ThresholdSubconditionASCII []struct {
	Weight    int32          `json:"weight"`
	Condition ConditionASCII `json:"condition"`
}

type ThresholdSubconditionASN1

type ThresholdSubconditionASN1 []struct {
	Weight    int32         `asn1:"weight"`
	Condition ConditionASN1 `asn1:"condition"`
}

type ThresholdSubfulfillmentASCII

type ThresholdSubfulfillmentASCII []struct {
	Weight      int32            `json:"weight,default:1"`
	Condition   ConditionASCII   `json:"condition,optional"`
	Fulfillment FulfillmentASCII `json:"fulfillment,optional"`
}

type ThresholdSubfulfillmentASN1

type ThresholdSubfulfillmentASN1 []struct {
	Weight      int32           `asn1:"weight,default:1"`
	Condition   ConditionASN1   `asn1:"condition,optional"`
	Fulfillment FulfillmentASN1 `asn1:"fulfillment,optional"`
}

Jump to

Keyboard shortcuts

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