Repository navigation
workspace sdk credential encoders
Credential encoders are Workspace components that send credential identifiers to external encoding hardware. In Access Control views, operators trigger an encoder from an Encode command. The system calls your component with credential data, and your component performs the encoding.
Credential encoders are used for workflows such as:
- Writing credential identifiers to card printers and encoders.
- Sending credential data to desktop encoding stations.
- Integrating custom encoding hardware through vendor SDKs.
- Your module creates the encoder component, calls
Initialize(Workspace), and registers it withWorkspace.Components. - Security Center selects the encoder when a compatible credential-encoding workflow needs it.
- The framework passes a
CredentialEncoderDatainstance toEncode(...). - Your implementation transforms the input into the encoded output required by the target system.
- When the module unloads, it unregisters the encoder.
Inherit from CredentialEncoder and implement Encode.
using System;
using System.Windows;
using Genetec.Sdk.Workspace.Components.CredentialEncoder;
public sealed class SampleCredentialEncoder : CredentialEncoder
{
public override string Name => "Encode with sample encoder";
public override int Priority => 200;
public override Guid UniqueId { get; } =
new("E0FEF1FF-5A3D-45D4-AE2D-FF8E1997875C");
public override void Encode(CredentialEncoderData data)
{
if (data?.Credential == null)
return;
MessageBox.Show($"Encoding {data.Credential.Name} " + $"({data.Credential.Type})", "Credential encoder sample", MessageBoxButton.OK, MessageBoxImage.Information);
}
}| Member | Description |
|---|---|
Name |
Display name shown in encode menus and buttons |
UniqueId |
GUID that uniquely identifies the encoder |
Encode(CredentialEncoderData) |
Called when an operator runs an encode action |
| Member | Default | Description |
|---|---|---|
Priority |
int.MaxValue |
Controls ordering. Lower values appear first. |
The Encode method receives a CredentialEncoderData
object and returns void. The Access Control callers do not
consume a return value from this operation.
The method is called from encode UI actions after the
current credential is converted to CredentialFormat.
If conversion fails, the system does not call your encoder.
The Access Control callers invoke Encode directly and do
not catch exceptions from your implementation.
| Member | Type | Description |
|---|---|---|
Credential |
CredentialFormat |
Credential format data to encode |
Document |
FixedDocument |
Optional print document. Built-in encode button and credential contextual action paths call encoders without a document. |
The Credential object is a CredentialFormat. Beyond the display members shown in the sample, it exposes the values you write to the encoder:
-
RawData: The encoded credential data as a string -
BitLength: The number of bits -
FormatId: The credential format identifier -
Type: The credential type
Read these values to build the payload your hardware expects.
- The operator clicks Encode or selects exactly one credential and runs its contextual encode action. The contextual action cannot run when multiple credentials are selected.
- The system resolves the selected encoder. If no saved encoder is found, it falls back to the first available encoder.
- The system converts the selected credential to
CredentialFormat. If the conversion produces no result, the encoder is not called. - The system calls
Encode(CredentialEncoderData)on your component.
Encoders are ordered by Priority in ascending order.
public override int Priority => 200;The selected encoder is persisted in Workspace options.
On the next initialization, the UI restores that encoder
when its UniqueId is still available.
Register the encoder in Load and unregister it in
Unload.
using Genetec.Sdk;
using Genetec.Sdk.Workspace.Modules;
public class SampleModule : Module
{
private SampleCredentialEncoder m_encoder;
public override void Load()
{
if (Workspace.ApplicationType is ApplicationType.SecurityDesk or ApplicationType.ConfigTool)
{
m_encoder = new SampleCredentialEncoder();
m_encoder.Initialize(Workspace);
Workspace.Components.Register(m_encoder);
}
}
public override void Unload()
{
if (m_encoder != null)
{
Workspace.Components.Unregister(m_encoder);
m_encoder = null;
}
}
}Note
Credential encoders require a certificate file to load. See About Workspace SDK certificates for certificate requirements.
| Member | Type | Description |
|---|---|---|
Name |
Property (abstract, inherited) | Gets the encoder display name |
UniqueId |
Property (abstract, inherited) | Gets the encoder unique identifier |
Type |
Property | Gets the component type (Components.CredentialEncoder) |
Priority |
Property (virtual) | Gets encoder ordering priority |
IsAvailable |
Property (inherited) | Gets or sets component availability |
Workspace |
Property (inherited) | Gets the workspace after initialization |
Encode(CredentialEncoderData) |
Method (abstract) | Encodes the credential data |
Initialize(Workspace) |
Method (inherited) | Passes the current workspace to the component. Call this before registering the component. |
Initialize() |
Method (virtual, inherited) | Override this hook to run setup after Workspace is available. |
- About the Workspace SDK: Workspace SDK architecture and module lifecycle.
- About components: The component registry and registration lifecycle.
- About credential readers: Reading credential data from external hardware.
- About workspace modules: Workspace module class and Load/Unload lifecycle.
- About Workspace SDK certificates: Certificate requirements for workspace components.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting