Stay organized with collections
Save and categorize content based on your preferences.
Principal
interface Principal
Known Direct Subclasses
Group |
This interface is used to represent a group of principals.
|
Identity |
This class represents identities: real-world objects such as people, companies or organizations whose identities can be authenticated using their public keys.
|
UserPrincipal |
A Principal representing an identity used to determine access rights to objects in a file system.
|
X500Principal |
This class represents an X.
|
|
Known Indirect Subclasses
GroupPrincipal |
A UserPrincipal representing a group identity, used to determine access rights to objects in a file system.
|
IdentityScope |
This class represents a scope for identities.
|
Signer |
This class is used to represent an Identity that can also digitally sign data.
|
|
This interface represents the abstract notion of a principal, which can be used to represent any entity, such as an individual, a corporation, and a login id.
Summary
Public methods |
abstract String! |
Returns the name of this principal.
|
open Boolean |
Returns true if the specified subject is implied by this principal.
|
Public methods
getName
abstract fun getName(): String!
Returns the name of this principal.
Return |
String! |
the name of this principal. |
implies
open fun implies(subject: Subject!): Boolean
Returns true if the specified subject is implied by this principal.
Parameters |
subject |
Subject!: the Subject |
Return |
Boolean |
true if subject is non-null and is implied by this principal, or false otherwise. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Principal\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPrincipal\n=========\n\n```\ninterface Principal\n```\n\n|------------------------------|\n| [java.security.Principal](#) |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [Group](/reference/kotlin/java/security/acl/Group), [Identity](/reference/kotlin/java/security/Identity), [UserPrincipal](../nio/file/attribute/UserPrincipal.html#), [X500Principal](../../javax/security/auth/x500/X500Principal.html#) |---------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Group](/reference/kotlin/java/security/acl/Group) | This interface is used to represent a group of principals. | | [Identity](/reference/kotlin/java/security/Identity) | This class represents identities: real-world objects such as people, companies or organizations whose identities can be authenticated using their public keys. | | [UserPrincipal](../nio/file/attribute/UserPrincipal.html#) | A `Principal` representing an identity used to determine access rights to objects in a file system. | | [X500Principal](../../javax/security/auth/x500/X500Principal.html#) | This class represents an X. | |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Indirect Subclasses [GroupPrincipal](../nio/file/attribute/GroupPrincipal.html#), [IdentityScope](/reference/kotlin/java/security/IdentityScope), [Signer](/reference/kotlin/java/security/Signer) |----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------| | [GroupPrincipal](../nio/file/attribute/GroupPrincipal.html#) | A `UserPrincipal` representing a *group identity*, used to determine access rights to objects in a file system. | | [IdentityScope](/reference/kotlin/java/security/IdentityScope) | This class represents a scope for identities. | | [Signer](/reference/kotlin/java/security/Signer) | This class is used to represent an Identity that can also digitally sign data. | |\n\nThis interface represents the abstract notion of a principal, which can be used to represent any entity, such as an individual, a corporation, and a login id.\n\nSummary\n-------\n\n| Public methods ||\n|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getName](#getName())`()` Returns the name of this principal. |\n| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [implies](#implies(javax.security.auth.Subject))`(`subject:` `[Subject](../../javax/security/auth/Subject.html#)!`)` Returns true if the specified subject is implied by this principal. |\n\nPublic methods\n--------------\n\n### getName\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getName(): String!\n```\n\nReturns the name of this principal.\n\n| Return ||\n|-----------------------------------------------------------------------------------|-----------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | the name of this principal. |\n\n### implies\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun implies(subject: Subject!): Boolean\n```\n\nReturns true if the specified subject is implied by this principal.\n\n| Parameters ||\n|-----------|--------------------------------------------------------------------|\n| `subject` | [Subject](../../javax/security/auth/Subject.html#)!: the `Subject` |\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if `subject` is non-null and is implied by this principal, or false otherwise. |"]]