IC4J API Docs
  • Overview
    • Introduction
  • Quick Start
  • License
  • Reference
    • API Reference
      • Install IC4J Libraries
      • Supported Types
      • ReplicaTransport
      • Identity
      • Principal
      • AgentBuilder
      • ProxyBuilder
      • Using IDLArgs
      • QueryBuilder and UpdateBuilder
      • Using Raw Agent Methods
      • Handle Binary Payloads
      • Object Serializers and Deserializers
        • Pojo Serializer and Deserializer
        • JSON Jackson Serializer and Deserializer
        • JSON Gson Serializer and Deserializer
        • XML DOM Serializer and Deserializer
        • XML JAXB Serializer and Deserializer
        • JDBC Serializer
      • Android Development
Powered by GitBook
On this page
  1. Reference
  2. API Reference

Principal

PreviousIdentityNextAgentBuilder

Last updated 2 years ago

A principal is an entity that can be authenticated by the Internet Computer blockchain. Principals that interact with the Internet Computer blockchain often do so via an identity.

To create a object in Java one of these static methods can be used.

1) To create Principal from Java String object.

Principal principal = Principal.fromString(stringValue);

2) To create Principal from Java byte[] array object.

Principal principal = Principal.from(byteArrayValue);

3) To create Management Canister Principal.

Principal principal = Principal.managementCanister() ;

4) To create Anonymous Principal.

Principal principal = Principal.anonymous() ;

5) To create Self Authenticating Principal from public key byte[] array object.

Principal principal = Principal.selfAuthenticating(publicKeyByteArrayValue) ;
Principal