OSID Logo
OSID Specifications
authentication keys package
Version 3.0.0
Release Candidate Preview
Interfaceosid.authentication.keys.KeyAdminSession
Implementsosid.OsidSession
Description

This session provides methods to creating, updating and deleting Key objects. Keys are managed separately from the Agent. Each Agent maps to a zero or one Key and every Key maps to one Agent.

MethodgetAgencyId
Description

Gets the Agency Id associated with this session.

Returnosid.id.Idthe Agency Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetAgency
Description

Gets the Agency associated with this session.

Returnosid.authentication.Agencythe Agency associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateKeys
Description

Tests if this user can create Keys. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Key will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Key creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateKeyWithRecordTypes
Description

Tests if this user can create a single Key using the desired record interface types. While AuthenticationKeysManager.getKeyRecordTypes() can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specific Key. Providing an empty array tests if a Key can be created with no records.

Parametersosid.type.Type[]keyRecordTypesarray of key record types
Returnboolean true if Key creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT keyRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetKeyFormForCreate
Description

Gets the key form for creating and updating new keys. A new form should be requested for each create transaction.

Parametersosid.id.IdagentIdthe Id of the Agent
osid.type.Type[]keyRecordTypesarray of key record types
Returnosid.authentication.keys.KeyFormthe key form
ErrorsNOT_FOUND agentId is not found
NULL_ARGUMENT agentId or keyRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateKey
Description

Creates a new Key.

Parametersosid.authentication.keys.KeyFormkeyFormthe form for this Key
Returnosid.authentication.keys.Key keyForm already used in a create transaction
ErrorsILLEGAL_STATEagent already has a key
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT keyForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED keyForm did not originate from getKeyFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateKeys
Description

Tests if this user can update Keys. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Key will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if key modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetKeyFormForUpdate
Description

Gets the key form for updating an existing key.

Parametersosid.id.IdkeyIdthe Id of the Key
Returnosid.authentication.keys.KeyFormthe key form
ErrorsNOT_FOUND keyId is not found
NULL_ARGUMENT keyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateKey
Description

Updates a key for an agent.

Parametersosid.authentication.keys.KeyFormkeyFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE keyForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT keyForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED keyForm did not originate from getKeyFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteKeys
Description

Tests if this user can delete Keys. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Key will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Key deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteKey
Description

Deletes a Key.

Parametersosid.id.IdkeyIdthe Id of the Key
ErrorsNOT_FOUNDa Key was not found identified by the given Id
NULL_ARGUMENT keyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.