Compartilhar via


Subject Constructors

Definition

Overloads

Subject()

Create an instance of a Subject with an empty Set of Principals and empty Sets of public and private credentials.

Subject(Boolean, ICollection<IPrincipal>, ICollection<Object>, ICollection<Object>)

Create an instance of a Subject with Principals and credentials.

Subject()

Create an instance of a Subject with an empty Set of Principals and empty Sets of public and private credentials.

[Android.Runtime.Register(".ctor", "()V", "")]
public Subject ();
Attributes

Remarks

Create an instance of a Subject with an empty Set of Principals and empty Sets of public and private credentials.

The newly constructed Sets check whether this Subject has been set read-only before permitting subsequent modifications. The newly created Sets also prevent illegal modifications by ensuring that callers have sufficient permissions.

To modify the Principals Set, the caller must have AuthPermission("modifyPrincipals"). To modify the public credential Set, the caller must have AuthPermission("modifyPublicCredentials"). To modify the private credential Set, the caller must have AuthPermission("modifyPrivateCredentials").

Java documentation for javax.security.auth.Subject.Subject().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Subject(Boolean, ICollection<IPrincipal>, ICollection<Object>, ICollection<Object>)

Create an instance of a Subject with Principals and credentials.

[Android.Runtime.Register(".ctor", "(ZLjava/util/Set;Ljava/util/Set;Ljava/util/Set;)V", "")]
public Subject (bool readOnly, System.Collections.Generic.ICollection<Java.Security.IPrincipal>? principals, System.Collections.Generic.ICollection<object>? pubCredentials, System.Collections.Generic.ICollection<object>? privCredentials);
[<Android.Runtime.Register(".ctor", "(ZLjava/util/Set;Ljava/util/Set;Ljava/util/Set;)V", "")>]
new Javax.Security.Auth.Subject : bool * System.Collections.Generic.ICollection<Java.Security.IPrincipal> * System.Collections.Generic.ICollection<obj> * System.Collections.Generic.ICollection<obj> -> Javax.Security.Auth.Subject

Parameters

readOnly
Boolean

true if the Subject is to be read-only, and false otherwise. <p>

principals
ICollection<IPrincipal>

the Set of Principals to be associated with this Subject. <p>

pubCredentials
ICollection<Object>

the Set of public credentials to be associated with this Subject. <p>

privCredentials
ICollection<Object>

the Set of private credentials to be associated with this Subject.

Attributes

Remarks

Create an instance of a Subject with Principals and credentials.

The Principals and credentials from the specified Sets are copied into newly constructed Sets. These newly created Sets check whether this Subject has been set read-only before permitting subsequent modifications. The newly created Sets also prevent illegal modifications by ensuring that callers have sufficient permissions.

To modify the Principals Set, the caller must have AuthPermission("modifyPrincipals"). To modify the public credential Set, the caller must have AuthPermission("modifyPublicCredentials"). To modify the private credential Set, the caller must have AuthPermission("modifyPrivateCredentials").

Java documentation for javax.security.auth.Subject.Subject(boolean, java.util.Set<? extends java.security.Principal>, java.util.Set<?>, java.util.Set<?>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to