2.8 KiB
lease_set
-- import "github.com/go-i2p/go-i2p/lib/common/lease_set"
Package lease_set implements the I2P LeastSet common data structure
Usage
const (
LEASE_SET_PUBKEY_SIZE = 256
LEASE_SET_SPK_SIZE = 128
LEASE_SET_SIG_SIZE = 40
)
Sizes of various structures in an I2P LeaseSet
func ReadDestinationFromLeaseSet
func ReadDestinationFromLeaseSet(data []byte) (destination Destination, remainder []byte, err error)
type LeaseSet
type LeaseSet []byte
LeaseSet is the represenation of an I2P LeaseSet.
https://geti2p.net/spec/common-structures#leaseset
func NewLeaseSet
func NewLeaseSet(
destination Destination,
encryptionKey crypto.RecievingPublicKey,
signingKey crypto.SigningPublicKey,
leases []Lease,
signingPrivateKey crypto.SigningPrivateKey,
) (LeaseSet, error)
func (LeaseSet) Destination
func (lease_set LeaseSet) Destination() (destination Destination, err error)
Destination returns the Destination as []byte.
func (LeaseSet) DestinationDeux
func (lease_set LeaseSet) DestinationDeux() (destination Destination, err error)
func (LeaseSet) LeaseCount
func (lease_set LeaseSet) LeaseCount() (count int, err error)
LeaseCount returns the numbert of leases specified by the LeaseCount value as int. returns errors encountered during parsing.
func (LeaseSet) Leases
func (lease_set LeaseSet) Leases() (leases []Lease, err error)
Leases returns the leases as []Lease. returns errors encountered during parsing.
func (LeaseSet) NewestExpiration
func (lease_set LeaseSet) NewestExpiration() (newest Date, err error)
NewestExpiration returns the newest lease expiration as an I2P Date. Returns errors encountered during parsing.
func (LeaseSet) OldestExpiration
func (lease_set LeaseSet) OldestExpiration() (earliest Date, err error)
OldestExpiration returns the oldest lease expiration as an I2P Date. Returns errors encountered during parsing.
func (LeaseSet) PublicKey
func (lease_set LeaseSet) PublicKey() (public_key crypto.ElgPublicKey, err error)
PublicKey returns the public key as crypto.ElgPublicKey. Returns errors encountered during parsing.
func (LeaseSet) Signature
func (lease_set LeaseSet) Signature() (signature signature.Signature, err error)
Signature returns the signature as Signature. returns errors encountered during parsing.
func (LeaseSet) SigningKey
func (lease_set LeaseSet) SigningKey() (signing_public_key crypto.SigningPublicKey, err error)
SigningKey returns the signing public key as crypto.SigningPublicKey. returns errors encountered during parsing.
func (LeaseSet) Verify
func (lease_set LeaseSet) Verify() error
Verify returns nil
lease_set
github.com/go-i2p/go-i2p/lib/common/lease_set