Package system.security.principal
Class WindowsIdentity
- java.lang.Object
-
- org.mases.jcobridge.netreflection.NetObject
-
- system.security.claims.ClaimsIdentity
-
- system.security.principal.WindowsIdentity
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,IJCOBridgeReflected
,IDeserializationCallback
,ISerializable
public class WindowsIdentity extends ClaimsIdentity implements ISerializable, IDeserializationCallback, java.lang.AutoCloseable
The base .NET class managing System.Security.Principal.WindowsIdentity, System.Security.Principal.Windows, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a..NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Security.Principal.WindowsIdentity
Powered by JCOBridge: more info at https://www.jcobridge.com
- Author:
- MASES s.r.l https://masesgroup.com
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
assemblyFullName
Fully assembly qualified name: System.Security.Principal.Windows, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3astatic java.lang.String
assemblyShortName
Assembly name: System.Security.Principal.Windowsstatic java.lang.String
className
Qualified class name: System.Security.Principal.WindowsIdentitystatic JCType
classType
The type managed from JCOBridge.
-
Constructor Summary
Constructors Constructor Description WindowsIdentity()
WindowsIdentity(java.lang.Object instance)
Internal constructor.WindowsIdentity(java.lang.String sUserPrincipalName)
WindowsIdentity(SerializationInfo info, StreamingContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WindowsIdentity
cast(IJCOBridgeReflected from)
Try to cast theIJCOBridgeReflected
instance intoWindowsIdentity
, a cast assert is made to check if types are compatible.ClaimsIdentity
Clone()
void
close()
void
Dispose()
SafeAccessTokenHandle
getAccessToken()
static WindowsIdentity
GetAnonymous()
static WindowsIdentity
GetCurrent()
static WindowsIdentity
GetCurrent(boolean ifImpersonating)
static WindowsIdentity
GetCurrent(TokenAccessLevels desiredAccess)
IdentityReferenceCollection
getGroups()
TokenImpersonationLevel
getImpersonationLevel()
boolean
getIsAnonymous()
boolean
getIsGuest()
boolean
getIsSystem()
java.lang.String
getJCOAssemblyName()
Returns the reflected Assembly namejava.lang.String
getJCOClassName()
Returns the reflected Class namejava.lang.Object
getJCOInstance()
Returns the instantiated classjava.lang.String
getJCOObjectName()
Returns the reflected Class name used to build the objectJCType
getJCOType()
Returns the instantiated class TypeSecurityIdentifier
getOwner()
SecurityIdentifier
getUser()
static void
RunImpersonated(SafeAccessTokenHandle safeAccessTokenHandle, Action action)
void
setJCOInstance(JCObject instance)
-
Methods inherited from class system.security.claims.ClaimsIdentity
AddClaim, FindFirst, getActor, getAuthenticationType, getBootstrapContext, getIsAuthenticated, getLabel, getName, getNameClaimType, getRoleClaimType, HasClaim, RemoveClaim, setActor, setBootstrapContext, setLabel, TryRemoveClaim, WriteTo
-
Methods inherited from class org.mases.jcobridge.netreflection.NetObject
Equals, Equals, GetHashCode, GetType, hashCode, toString, ToString
-
Methods inherited from interface system.runtime.serialization.IDeserializationCallback
OnDeserialization
-
Methods inherited from interface system.runtime.serialization.ISerializable
GetObjectData
-
-
-
-
Field Detail
-
assemblyFullName
public static final java.lang.String assemblyFullName
Fully assembly qualified name: System.Security.Principal.Windows, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a- See Also:
- Constant Field Values
-
assemblyShortName
public static final java.lang.String assemblyShortName
Assembly name: System.Security.Principal.Windows- See Also:
- Constant Field Values
-
className
public static final java.lang.String className
Qualified class name: System.Security.Principal.WindowsIdentity- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WindowsIdentity
public WindowsIdentity(java.lang.Object instance) throws java.lang.Throwable
Internal constructor. Use with caution- Throws:
java.lang.Throwable
-
WindowsIdentity
public WindowsIdentity() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
WindowsIdentity
public WindowsIdentity(SerializationInfo info, StreamingContext context) throws java.lang.Throwable, ArgumentNullException, ArgumentException, PlatformNotSupportedException, ArgumentOutOfRangeException, CultureNotFoundException, InvalidOperationException, IndexOutOfRangeException, RankException, ArrayTypeMismatchException
-
WindowsIdentity
public WindowsIdentity(java.lang.String sUserPrincipalName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, PlatformNotSupportedException, ArgumentOutOfRangeException, CultureNotFoundException, NotSupportedException, InvalidOperationException, ObjectDisposedException, IndexOutOfRangeException, RankException, ArrayTypeMismatchException, MissingMethodException, TargetInvocationException, FormatException, SecurityException, OutOfMemoryException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
PlatformNotSupportedException
ArgumentOutOfRangeException
CultureNotFoundException
NotSupportedException
InvalidOperationException
ObjectDisposedException
IndexOutOfRangeException
RankException
ArrayTypeMismatchException
MissingMethodException
TargetInvocationException
FormatException
SecurityException
OutOfMemoryException
-
-
Method Detail
-
getJCOAssemblyName
public java.lang.String getJCOAssemblyName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Assembly name- Specified by:
getJCOAssemblyName
in interfaceIDeserializationCallback
- Specified by:
getJCOAssemblyName
in interfaceIJCOBridgeReflected
- Specified by:
getJCOAssemblyName
in interfaceISerializable
- Overrides:
getJCOAssemblyName
in classClaimsIdentity
- Returns:
- A
String
representing the Fullname of reflected Assembly
-
getJCOClassName
public java.lang.String getJCOClassName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Class name- Specified by:
getJCOClassName
in interfaceIDeserializationCallback
- Specified by:
getJCOClassName
in interfaceIJCOBridgeReflected
- Specified by:
getJCOClassName
in interfaceISerializable
- Overrides:
getJCOClassName
in classClaimsIdentity
- Returns:
- A
String
representing the Fullname of reflected Class
-
getJCOObjectName
public java.lang.String getJCOObjectName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Class name used to build the object- Specified by:
getJCOObjectName
in interfaceIDeserializationCallback
- Specified by:
getJCOObjectName
in interfaceIJCOBridgeReflected
- Specified by:
getJCOObjectName
in interfaceISerializable
- Overrides:
getJCOObjectName
in classClaimsIdentity
- Returns:
- A
String
representing the name used to allocated the object in CLR context
-
getJCOInstance
public java.lang.Object getJCOInstance()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class- Specified by:
getJCOInstance
in interfaceIDeserializationCallback
- Specified by:
getJCOInstance
in interfaceIJCOBridgeReflected
- Specified by:
getJCOInstance
in interfaceISerializable
- Overrides:
getJCOInstance
in classClaimsIdentity
- Returns:
- An
Object
representing the CLR instance of the instantiated Class
-
setJCOInstance
public void setJCOInstance(JCObject instance)
- Overrides:
setJCOInstance
in classClaimsIdentity
-
getJCOType
public JCType getJCOType()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class Type- Specified by:
getJCOType
in interfaceIDeserializationCallback
- Specified by:
getJCOType
in interfaceIJCOBridgeReflected
- Specified by:
getJCOType
in interfaceISerializable
- Overrides:
getJCOType
in classClaimsIdentity
- Returns:
- A
JCType
representing the CLR Type of the instantiated Class
-
cast
public static WindowsIdentity cast(IJCOBridgeReflected from) throws java.lang.Throwable
Try to cast theIJCOBridgeReflected
instance intoWindowsIdentity
, a cast assert is made to check if types are compatible.- Parameters:
from
-IJCOBridgeReflected
instance to be casted- Returns:
WindowsIdentity
instance- Throws:
java.lang.Throwable
- in case of error during cast operation
-
Clone
public ClaimsIdentity Clone() throws java.lang.Throwable, NotSupportedException, ArgumentException, ArgumentNullException, InvalidOperationException, ArgumentOutOfRangeException, IndexOutOfRangeException, RankException, ArrayTypeMismatchException, PlatformNotSupportedException, ObjectDisposedException, MissingMethodException, TargetInvocationException, SecurityException
- Overrides:
Clone
in classClaimsIdentity
- Throws:
java.lang.Throwable
NotSupportedException
ArgumentException
ArgumentNullException
InvalidOperationException
ArgumentOutOfRangeException
IndexOutOfRangeException
RankException
ArrayTypeMismatchException
PlatformNotSupportedException
ObjectDisposedException
MissingMethodException
TargetInvocationException
SecurityException
-
GetAnonymous
public static WindowsIdentity GetAnonymous() throws java.lang.Throwable, ArgumentNullException, ArgumentException, PlatformNotSupportedException, ArgumentOutOfRangeException, CultureNotFoundException, InvalidOperationException, IndexOutOfRangeException, RankException, ArrayTypeMismatchException
-
GetCurrent
public static WindowsIdentity GetCurrent() throws java.lang.Throwable, MissingMethodException, TargetInvocationException, PlatformNotSupportedException, ArgumentNullException, ArgumentException, ArgumentOutOfRangeException, IndexOutOfRangeException, ArrayTypeMismatchException, NotSupportedException, InvalidOperationException, FormatException, SecurityException, ObjectDisposedException
- Throws:
java.lang.Throwable
MissingMethodException
TargetInvocationException
PlatformNotSupportedException
ArgumentNullException
ArgumentException
ArgumentOutOfRangeException
IndexOutOfRangeException
ArrayTypeMismatchException
NotSupportedException
InvalidOperationException
FormatException
SecurityException
ObjectDisposedException
-
GetCurrent
public static WindowsIdentity GetCurrent(boolean ifImpersonating) throws java.lang.Throwable, MissingMethodException, TargetInvocationException, PlatformNotSupportedException, ArgumentNullException, ArgumentException, ArgumentOutOfRangeException, IndexOutOfRangeException, ArrayTypeMismatchException, NotSupportedException, InvalidOperationException, FormatException, SecurityException, ObjectDisposedException
- Throws:
java.lang.Throwable
MissingMethodException
TargetInvocationException
PlatformNotSupportedException
ArgumentNullException
ArgumentException
ArgumentOutOfRangeException
IndexOutOfRangeException
ArrayTypeMismatchException
NotSupportedException
InvalidOperationException
FormatException
SecurityException
ObjectDisposedException
-
GetCurrent
public static WindowsIdentity GetCurrent(TokenAccessLevels desiredAccess) throws java.lang.Throwable, MissingMethodException, TargetInvocationException, PlatformNotSupportedException, ArgumentNullException, ArgumentException, ArgumentOutOfRangeException, IndexOutOfRangeException, ArrayTypeMismatchException, NotSupportedException, InvalidOperationException, FormatException, SecurityException, ObjectDisposedException
- Throws:
java.lang.Throwable
MissingMethodException
TargetInvocationException
PlatformNotSupportedException
ArgumentNullException
ArgumentException
ArgumentOutOfRangeException
IndexOutOfRangeException
ArrayTypeMismatchException
NotSupportedException
InvalidOperationException
FormatException
SecurityException
ObjectDisposedException
-
Dispose
public void Dispose() throws java.lang.Throwable, ObjectDisposedException, ArgumentNullException
- Throws:
java.lang.Throwable
ObjectDisposedException
ArgumentNullException
-
RunImpersonated
public static void RunImpersonated(SafeAccessTokenHandle safeAccessTokenHandle, Action action) throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, ArgumentNullException, MissingMethodException, TargetInvocationException, SecurityException
- Throws:
java.lang.Throwable
ArgumentException
ArgumentOutOfRangeException
PlatformNotSupportedException
NotSupportedException
ObjectDisposedException
InvalidOperationException
RankException
ArrayTypeMismatchException
ArgumentNullException
MissingMethodException
TargetInvocationException
SecurityException
-
close
public void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
getIsAnonymous
public boolean getIsAnonymous() throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, NotSupportedException, OutOfMemoryException, IndexOutOfRangeException, FormatException, SecurityException, AccessViolationException
- Throws:
java.lang.Throwable
ArgumentException
ArgumentOutOfRangeException
PlatformNotSupportedException
ObjectDisposedException
InvalidOperationException
RankException
ArrayTypeMismatchException
NotSupportedException
OutOfMemoryException
IndexOutOfRangeException
FormatException
SecurityException
AccessViolationException
-
getIsGuest
public boolean getIsGuest() throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, NotSupportedException, OutOfMemoryException, SecurityException, MissingMethodException, TargetInvocationException
- Throws:
java.lang.Throwable
ArgumentException
ArgumentOutOfRangeException
PlatformNotSupportedException
ObjectDisposedException
InvalidOperationException
RankException
ArrayTypeMismatchException
NotSupportedException
OutOfMemoryException
SecurityException
MissingMethodException
TargetInvocationException
-
getIsSystem
public boolean getIsSystem() throws java.lang.Throwable, ArgumentException, ArgumentOutOfRangeException, PlatformNotSupportedException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException, NotSupportedException, OutOfMemoryException, IndexOutOfRangeException, FormatException, SecurityException, AccessViolationException
- Throws:
java.lang.Throwable
ArgumentException
ArgumentOutOfRangeException
PlatformNotSupportedException
ObjectDisposedException
InvalidOperationException
RankException
ArrayTypeMismatchException
NotSupportedException
OutOfMemoryException
IndexOutOfRangeException
FormatException
SecurityException
AccessViolationException
-
getAccessToken
public SafeAccessTokenHandle getAccessToken() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
getGroups
public IdentityReferenceCollection getGroups() throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, PlatformNotSupportedException, ObjectDisposedException, OutOfMemoryException, ArgumentException, IndexOutOfRangeException, InvalidOperationException, FormatException, SecurityException, CultureNotFoundException, ArrayTypeMismatchException, AccessViolationException, RankException, InvalidCastException, NullReferenceException, NotSupportedException
- Throws:
java.lang.Throwable
ArgumentOutOfRangeException
ArgumentNullException
PlatformNotSupportedException
ObjectDisposedException
OutOfMemoryException
ArgumentException
IndexOutOfRangeException
InvalidOperationException
FormatException
SecurityException
CultureNotFoundException
ArrayTypeMismatchException
AccessViolationException
RankException
InvalidCastException
NullReferenceException
NotSupportedException
-
getOwner
public SecurityIdentifier getOwner() throws java.lang.Throwable, ArgumentNullException, PlatformNotSupportedException, ObjectDisposedException, OutOfMemoryException, ArgumentOutOfRangeException, ArgumentException, IndexOutOfRangeException, ArrayTypeMismatchException, InvalidOperationException, FormatException, SecurityException, CultureNotFoundException, NotSupportedException, AccessViolationException
- Throws:
java.lang.Throwable
ArgumentNullException
PlatformNotSupportedException
ObjectDisposedException
OutOfMemoryException
ArgumentOutOfRangeException
ArgumentException
IndexOutOfRangeException
ArrayTypeMismatchException
InvalidOperationException
FormatException
SecurityException
CultureNotFoundException
NotSupportedException
AccessViolationException
-
getUser
public SecurityIdentifier getUser() throws java.lang.Throwable, ArgumentNullException, PlatformNotSupportedException, ObjectDisposedException, OutOfMemoryException, ArgumentOutOfRangeException, ArgumentException, IndexOutOfRangeException, ArrayTypeMismatchException, InvalidOperationException, FormatException, SecurityException, CultureNotFoundException, NotSupportedException, AccessViolationException
- Throws:
java.lang.Throwable
ArgumentNullException
PlatformNotSupportedException
ObjectDisposedException
OutOfMemoryException
ArgumentOutOfRangeException
ArgumentException
IndexOutOfRangeException
ArrayTypeMismatchException
InvalidOperationException
FormatException
SecurityException
CultureNotFoundException
NotSupportedException
AccessViolationException
-
getImpersonationLevel
public TokenImpersonationLevel getImpersonationLevel() throws java.lang.Throwable, PlatformNotSupportedException, ObjectDisposedException, OutOfMemoryException, ArgumentOutOfRangeException, ArgumentException, IndexOutOfRangeException, FormatException, InvalidOperationException, SecurityException, CultureNotFoundException
-
-