IC4J API Docs
Search…
Principal
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 Principal 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) ;
Copy link