%SYS
X509Users Class Reference

This class maps a key to a User. More...

Inheritance diagram for X509Users:
Collaboration diagram for X509Users:

Static Public Member Functions

_.Library.Status Copy (_.Library.String LookupKey, _.Library.String NewLookupKey)
 Copy an X509User. More...
 
_.Library.Status Create (_.Library.String LookupKey, _.Library.String Username, _.Library.Boolean Enabled, _.Library.String Comment)
 Create a X509User. More...
 
_.Library.Status Delete (_.Library.String LookupKey)
 Delete an X509User. More...
 
_.Library.Boolean Exists (_.Library.String LookupKey, _.Library.ObjectHandle X509User, _.Library.Status Status)
 X509 User exists. More...
 
_.Library.Status Export (_.Library.String FileName, _.Library.Integer NumExported, _.Library.String LookupKeys, _.Library.String Usernames)
 This method exports X509User records to a file in xml format. More...
 
_.Library.Status Get (_.Library.String LookupKey, _.Library.String Properties)
 Get a X509User's properties. More...
 
_.Library.String GetX509LookupKey (_.Library.String CredentialsCandidate)
 Return the lookup key (SubjectDN) for an X509 Certificate. More...
 
_.Library.Status Import (_.Library.String FileName, _.Library.Integer NumImported, _.Library.Integer Flags)
 Import User records from an xml file. More...
 
_.Library.Status Modify (_.Library.String LookupKey, _.Library.String Properties)
 Modify a X509User's properties. More...
 

Public Attributes

 Comment
 Comment. More...
 
 Enabled
 Allow to log in via this key. More...
 
 LookupKey
 Comment. More...
 
 Username
 UserName to be logged in as. More...
 

Detailed Description

This class maps a key to a User.

The keys should be obtained from X509 certificates. Use X509Users.GetLookupKey() go get a standard key from a certificate.

Member Function Documentation

◆ Copy()

_.Library.Status Copy ( _.Library.String  LookupKey,
_.Library.String  NewLookupKey 
)
static

Copy an X509User.


Copy an existing X509User in the Security database to a new one.
Parameters:
LookupKey - LookupKey of the X509User to be copied.
NewLookupKey - LookupKey of the X509User to be created.

◆ Create()

_.Library.Status Create ( _.Library.String  LookupKey,
_.Library.String  Username,
_.Library.Boolean  Enabled,
_.Library.String  Comment 
)
static

Create a X509User.


Create a X509User in the Security database.
There are 2 ways to call this method and pass the parameters:

s x=##Class(Security.X509Users).Create(LookupKey,username,...)
or
s x=##Class(Security.X509Users).Create(LookupKey,.Properties)

Where Properties are contained in an array subscripted by property name, passed by reference. See the Get() method for a description of the Properies array. Valid properties for the Create() method are described below, other values are ignored.
Parameters:
LookupKey - Key used to lookup Username UserName - Name of the user associated with this key
Enabled - 0/1, account is disabled/enabled
Comment - Comment

◆ Delete()

_.Library.Status Delete ( _.Library.String  LookupKey)
static

Delete an X509User.


This method will delete a User from the security database.
Parameters:
LookupKey - Key to delete

◆ Exists()

_.Library.Boolean Exists ( _.Library.String  LookupKey,
_.Library.ObjectHandle  X509User,
_.Library.Status  Status 
)
static

X509 User exists.


This method checks for the existence of a user in the security database.
Parameters:
LookupKey - Lookup key of the user to check existence of
Requires the Admin_Secure:USE privilege to change the $USERNAME value.
Return values:
If Value of the method = 0 (User does not exist, or some error occured)
User = Null
Status = User "x" does not exist, or other error message<br>
If Value of the method = 1 (User exists)
User = Object handle to user
Status = User "x" already exists

◆ Export()

_.Library.Status Export ( _.Library.String  FileName,
_.Library.Integer  NumExported,
_.Library.String  LookupKeys,
_.Library.String  Usernames 
)
static

This method exports X509User records to a file in xml format.


Parameters:
Filename - Output file name
NumExported (byref) - Returns number of records exported.
LookupKeys - Comma separated list of Keys to export, "*" = All
Usernames - Comma separated list of Usernames, "*" = All. Export X509Users containing only these usernames

◆ Get()

_.Library.Status Get ( _.Library.String  LookupKey,
_.Library.String  Properties 
)
static

Get a X509User's properties.


Gets a X509User's properties from the security database.
Parameters:
Username - Name of the user to get
Return values:
Properties - Array of properties
Properties("Comment") - Comment
Properties("Enabled") - 0=Disabled, 1=Enabled
Properties("LookupKey") - Key used to find Username
Properties("Username") - Name of associated user

◆ GetX509LookupKey()

_.Library.String GetX509LookupKey ( _.Library.String  CredentialsCandidate)
static

Return the lookup key (SubjectDN) for an X509 Certificate.


There are four different ways this can be called where:

1) Certificate = DER Encoded X509 Certificate
2) Certificate = PEM Encoded X509 Certificate
3) Certificate = Alias of SYS.X509Credentials object
4) Certificate = A SYS.X509Credentials object

If the certificate cannot be found or is invalid, an empty string is returned.

◆ Import()

_.Library.Status Import ( _.Library.String  FileName,
_.Library.Integer  NumImported,
_.Library.Integer  Flags 
)
static

Import User records from an xml file.


Parameters:
FileName - Filename to import User records from
NumImported (byref) - Returns number of records imported
Flags - Control import
Bit 0 - Do not import records, just return count
Note: On failure, no records will be imported

◆ Modify()

_.Library.Status Modify ( _.Library.String  LookupKey,
_.Library.String  Properties 
)
static

Modify a X509User's properties.


Modifies a X509User's properties from the security database.
Parameters:
LookupKey - Key of the X509User to modify
Properties - Array of properties to modify.
See the Get() method for a description of the Properties parameter.
If a specific property is not passed in the properties array, the value is not modified.
If a value is unchanged it is not set to prevent the property modified state from being set.

Member Data Documentation

◆ Comment

Comment

Comment.


 

◆ Enabled

Enabled

Allow to log in via this key.


0 - Disable login.
1 - Enable login.
 

◆ LookupKey

LookupKey

Comment.


 

◆ Username

Username

UserName to be logged in as.