ztidentity

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: BSD-3-Clause Imports: 7 Imported by: 1

README

ZeroTier Identity Generator

Golang package that provides generation of ZeroTier cryptographic identities.

License

Copyright (c) 2021, ZeroTier, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZeroTierIdentity

type ZeroTierIdentity struct {
	// contains filtered or unexported fields
}

ZeroTierIdentity contains a public key, a private key, and a string representation of the identity.

func NewZeroTierIdentity

func NewZeroTierIdentity() (id ZeroTierIdentity)

NewZeroTierIdentity creates a new ZeroTier Identity. This can be a little bit time consuming due to one way proof of work requirements (usually a few hundred milliseconds).

func (*ZeroTierIdentity) ID

func (id *ZeroTierIdentity) ID() uint64

ID returns the ZeroTier address as a uint64

func (*ZeroTierIdentity) IDString

func (id *ZeroTierIdentity) IDString() string

IDString returns the NodeID as a 10-digit hex string

func (*ZeroTierIdentity) PrivateKey

func (id *ZeroTierIdentity) PrivateKey() *[64]byte

PrivateKey returns the bytes of the private key (or nil if not set)

func (*ZeroTierIdentity) PrivateKeyString

func (id *ZeroTierIdentity) PrivateKeyString() string

PrivateKeyString returns the full identity.secret if the private key is set, or an empty string if no private key is set.

func (*ZeroTierIdentity) PublicKey

func (id *ZeroTierIdentity) PublicKey() [64]byte

PublicKey returns the public key bytes

func (*ZeroTierIdentity) PublicKeyString

func (id *ZeroTierIdentity) PublicKeyString() string

PublicKeyString returns identity.public contents.

Jump to

Keyboard shortcuts

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