Skip to content

workspace sdk credential encoders

Andre Lafleur edited this page Oct 8, 2026 · 11 revisions

About 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.

How credential encoders work

  1. Your module creates the encoder component, calls Initialize(Workspace), and registers it with Workspace.Components.
  2. Security Center selects the encoder when a compatible credential-encoding workflow needs it.
  3. The framework passes a CredentialEncoderData instance to Encode(...).
  4. Your implementation transforms the input into the encoded output required by the target system.
  5. When the module unloads, it unregisters the encoder.

CredentialEncoder

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);
    }
}

CredentialEncoder required members

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

CredentialEncoder optional members

Member Default Description
Priority int.MaxValue Controls ordering. Lower values appear first.

Encode

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.

CredentialEncoderData properties

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.

Credential encoder data flow

  1. 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.
  2. The system resolves the selected encoder. If no saved encoder is found, it falls back to the first available encoder.
  3. The system converts the selected credential to CredentialFormat. If the conversion produces no result, the encoder is not called.
  4. The system calls Encode(CredentialEncoderData) on your component.

Priority and encoder selection

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.

Registering a credential encoder

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.

CredentialEncoder members

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.

See also

Platform SDK

Plugin SDK

Workspace SDK

Media SDK

Macro SDK

Web SDK

Synergis RIO

Media Gateway

Genetec Web Player

Clone this wiki locally