Documentation
¶
Index ¶
- Variables
- func Base32(anything string) string
- func GetI2PKeysLogger() *logrus.Logger
- func InitializeI2PKeysLogger()
- func StoreKeys(k I2PKeys, r string) error
- func StoreKeysIncompat(k I2PKeys, w io.Writer) error
- type I2PAddr
- type I2PDestHash
- type I2PKeys
- func (k I2PKeys) Addr() I2PAddr
- func (k I2PKeys) Ed25519PrivateKey() *ed25519.PrivateKey
- func (k I2PKeys) HostnameEntry(hostname string, opts crypto.SignerOpts) (string, error)
- func (k I2PKeys) Network() string
- func (k I2PKeys) Private() []byte
- func (k I2PKeys) PrivateKey() crypto.PrivateKey
- func (k I2PKeys) Public() crypto.PublicKey
- func (k I2PKeys) SecretKey() SecretKey
- func (k I2PKeys) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)
- func (k I2PKeys) String() string
- type SecretKey
Constants ¶
This section is empty.
Variables ¶
var StringIsBase64 bool
If you set this to true, Addr will return a base64 String()
Functions ¶
func Base32 ¶
Makes any string into a *.b32.i2p human-readable I2P address. This makes no sense, unless "anything" is an I2P destination of some sort.
func GetI2PKeysLogger ¶ added in v0.33.9
GetI2PKeysLogger returns the initialized logger
func InitializeI2PKeysLogger ¶ added in v0.33.9
func InitializeI2PKeysLogger()
Types ¶
type I2PAddr ¶
type I2PAddr string
I2PAddr represents an I2P destination, almost equivalent to an IP address. This is the humongously huge base64 representation of such an address, which really is just a pair of public keys and also maybe a certificate. (I2P hides the details of exactly what it is. Read the I2P specifications for more info.)
func FiveHundredAs ¶
func FiveHundredAs() I2PAddr
func NewI2PAddrFromBytes ¶
Creates a new I2P address from a byte array. The inverse of ToBytes().
func NewI2PAddrFromString ¶
Creates a new I2P address from a base64-encoded string. Checks if the address addr is in correct format. (If you know for sure it is, use I2PAddr(addr).)
func (I2PAddr) Base32 ¶
Returns the *.b32.i2p address of the I2P address. It is supposed to be a somewhat human-manageable 64 character long pseudo-domain name equivalent of the 516+ characters long default base64-address (the I2PAddr format). It is not possible to turn the base32-address back into a usable I2PAddr without performing a Lookup(). Lookup only works if you are using the I2PAddr from which the b32 address was generated.
func (I2PAddr) DestHash ¶
func (addr I2PAddr) DestHash() (h I2PDestHash)
type I2PDestHash ¶
type I2PDestHash [32]byte
an i2p destination hash, the .b32.i2p address if you will
func DestHashFromBytes ¶
func DestHashFromBytes(str []byte) (dhash I2PDestHash, err error)
create a desthash from a []byte array
func DestHashFromString ¶
func DestHashFromString(str string) (dhash I2PDestHash, err error)
create a desthash from a string b32.i2p address
func (I2PDestHash) Hash ¶
func (h I2PDestHash) Hash() string
get base64 representation of i2p dest sha256 hash(the 44-character one)
func (I2PDestHash) String ¶
func (h I2PDestHash) String() string
get string representation of i2p dest hash(base32 version)
type I2PKeys ¶
type I2PKeys struct { Address I2PAddr // only the public key Both string // both public and private keys }
The public and private keys associated with an I2P destination. I2P hides the details of exactly what this is, so treat them as blobs, but generally: One pair of DSA keys, one pair of ElGamal keys, and sometimes (almost never) also a certificate. String() returns you the full content of I2PKeys and Addr() returns the public keys.
func LoadKeys ¶
load keys from non-standard format by specifying a text file. If the file does not exist, generate keys, otherwise, fail closed.
func LoadKeysIncompat ¶
LoadKeysIncompat loads keys from a non-standard format
func NewDestination ¶
HELLO VERSION MIN=3.1 MAX=3.1 DEST GENERATE SIGNATURE_TYPE=7
func NewKeys ¶
Creates I2PKeys from an I2PAddr and a public/private keypair string (as generated by String().)
func (I2PKeys) Ed25519PrivateKey ¶
func (k I2PKeys) Ed25519PrivateKey() *ed25519.PrivateKey
func (I2PKeys) HostnameEntry ¶
func (I2PKeys) PrivateKey ¶
func (k I2PKeys) PrivateKey() crypto.PrivateKey