identity

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSON

type JSON struct {
	MspID                 string
	Roles                 []string
	PrivateKeySKI         []byte
	EnrollmentCertificate []byte
}

JSON representation of the user struct

type User

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

User represents a Fabric user registered at an MSP

func NewUser

func NewUser(name string, mspID string) *User

NewUser Constructor for a user. @param {string} name - The user name @param {string} mspID - The mspID for this user @returns {ca.User} new user

func (*User) EnrollmentCertificate

func (u *User) EnrollmentCertificate() []byte

EnrollmentCertificate Returns the underlying ECert representing this user’s identity.

func (*User) GenerateTcerts

func (u *User) GenerateTcerts(count int, attributes []string)

GenerateTcerts Gets a batch of TCerts to use for transaction. there is a 1-to-1 relationship between TCert and Transaction. The TCert can be generated locally by the SDK using the user’s crypto materials. @param {int} count how many in the batch to obtain @param {[]string} attributes list of attributes to include in the TCert @return {[]tcert} An array of TCerts

func (*User) Identity

func (u *User) Identity() ([]byte, error)

Identity returns client's serialized identity

func (*User) MspID

func (u *User) MspID() string

MspID returns the MSP for this user

func (*User) Name

func (u *User) Name() string

Name Get the user name. @returns {string} The user name.

func (*User) PrivateKey

func (u *User) PrivateKey() apicryptosuite.Key

PrivateKey returns the crypto suite representation of the private key

func (*User) Roles

func (u *User) Roles() []string

Roles Get the roles. @returns {[]string} The roles.

func (*User) SetEnrollmentCertificate

func (u *User) SetEnrollmentCertificate(cert []byte)

SetEnrollmentCertificate Set the user’s Enrollment Certificate.

func (*User) SetMspID

func (u *User) SetMspID(mspID string)

SetMspID sets the MSP for this user

func (*User) SetPrivateKey

func (u *User) SetPrivateKey(privateKey apicryptosuite.Key)

SetPrivateKey sets the crypto suite representation of the private key for this user

func (*User) SetRoles

func (u *User) SetRoles(roles []string)

SetRoles Set the roles. @param roles {[]string} The roles.

Jump to

Keyboard shortcuts

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