• API Overview
  • EBICS API
  • FinTS API
  • XS2A API
  • SEPA API
Search Results for

    Class EbicsPubKeyInfo

    A public RSA key.

    Inheritance
    System.Object
    EbicsElement
    EbicsPubKeyInfo
    Implements
    IEbicsJsonConverter
    Inherited Members
    EbicsElement.BuildXmlDocument(EbicsVersion)
    EbicsElement.Load(Stream, EbicsVersion)
    EbicsElement.Load(String, EbicsVersion)
    EbicsElement.Save(Stream, EbicsVersion)
    EbicsElement.Save(String, EbicsVersion)
    EbicsElement.FromBuffer(EbicsDataBuffer, EbicsVersion)
    EbicsElement.ToBuffer(EbicsVersion)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Subsembly.EBICS
    Assembly: Subsembly.EBICS.Core.dll
    Syntax
    public class EbicsPubKeyInfo : EbicsElement, IEbicsJsonConverter

    Properties

    Exponent

    The common exponent

    Declaration
    public EbicsDataBuffer Exponent { get; set; }
    Property Value
    Type Description
    EbicsDataBuffer

    Modulus

    The public modulus.

    Declaration
    public EbicsDataBuffer Modulus { get; set; }
    Property Value
    Type Description
    EbicsDataBuffer

    ModulusBitLength

    The number of significant bits in the Modulus.

    Declaration
    public int ModulusBitLength { get; }
    Property Value
    Type Description
    System.Int32

    PubKeyDigestAlgorithm

    Declaration
    public string PubKeyDigestAlgorithm { get; }
    Property Value
    Type Description
    System.String

    TimeStamp

    Optional time of key generation.

    Declaration
    public DateTime TimeStamp { get; set; }
    Property Value
    Type Description
    System.DateTime

    The value DateTime.MinValue indicates that no date is set.

    Remarks

    This corresponds to the XML element ebics:TimeStamp.

    Version

    The security operation and version.

    Declaration
    public EbicsSecurityCode Version { get; set; }
    Property Value
    Type Description
    EbicsSecurityCode
    Remarks

    This corresponds to (and actually selects) one of the XML elements ebics:AuthenticationVersion, ebics:SignatureVersion, or ebics:EncryptionVersion.

    X509Certificate

    The X.509 certificate for this key. This is optional before EBICS 3.0, and mandatory starting with EBICS 3.0. It is always needed for French EBICS implementations.

    Declaration
    public EbicsDataBuffer X509Certificate { get; set; }
    Property Value
    Type Description
    EbicsDataBuffer
    Remarks

    If no certificate was issued for the user keys, then a self-signed certificate can be used by calling CreateSelfSignedCertificate(EbicsPrivKey, String) before submitting user keys.

    Just parsing the EbicsPubKeyInfo does not validate the authority signature of this certificate.

    See Also
    CreateSelfSignedCertificate(EbicsPrivKey, String)

    Methods

    BuildPubKeyDigest(String, Boolean)

    Builds a public key digest element.

    Declaration
    public EbicsPubKeyDigest BuildPubKeyDigest(string sRootTag, bool fFromCertificate)
    Parameters
    Type Name Description
    System.String sRootTag

    The root tag to be used for the returned element. This is usually one of "EncryptionPubKeyDigest", "Authentication", or "Encryption".

    System.Boolean fFromCertificate
    Returns
    Type Description
    EbicsPubKeyDigest
    Remarks

    The returned element has a "Version" and an "Algorithm" attribute. The value of these attributes are derived from the Version of this public key.

    BuildXml(XmlDocument, EbicsVersion)

    Declaration
    public override XmlElement BuildXml(XmlDocument xmlDocument, EbicsVersion nVersion)
    Parameters
    Type Name Description
    System.Xml.XmlDocument xmlDocument
    EbicsVersion nVersion

    The EBICS version for which to build the XML element.

    Returns
    Type Description
    System.Xml.XmlElement
    Overrides
    EbicsElement.BuildXml(XmlDocument, EbicsVersion)
    Remarks

    This creates an XML element with the root node SignaturePubKeyInfo, AuthenticationPubKeyInfo, or EncryptionPubKeyInfo, depending on the current value of the Version property.

    CheckCertificateSignature(EbicsPubKeyInfo)

    Check the authority signature of the X509Certificate.

    Declaration
    public bool CheckCertificateSignature(EbicsPubKeyInfo aAuthPubKey)
    Parameters
    Type Name Description
    EbicsPubKeyInfo aAuthPubKey

    The public key of the authority to check the certificate signature with. For a self signed certificate this can be provided as this. This must not be null.

    Returns
    Type Description
    System.Boolean

    If the authority signature of the X509Certificate was successfully verfified with the given public key, then true is returned. If the signature is invalid, then false is returned.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The parameter aAuthPubKey was null.

    System.InvalidOperationException

    The X509Certificate property was null.

    CreatePubKeyInfo(JsonObject)

    Declaration
    public static EbicsPubKeyInfo CreatePubKeyInfo(JsonObject jsonObject)
    Parameters
    Type Name Description
    JsonObject jsonObject
    Returns
    Type Description
    EbicsPubKeyInfo

    CreateSelfSignedCertificate(EbicsPrivKey, String)

    Declaration
    public void CreateSelfSignedCertificate(EbicsPrivKey aPrivKey, string sCommonName)
    Parameters
    Type Name Description
    EbicsPrivKey aPrivKey

    A private key for signing the certificate. This key must match the public Modulus and Exponent of this instance.

    System.String sCommonName

    Preferably the caller should use the UserID as the common name of the certificate subject. If this is null, then the constant "EBICS" will be used.

    Encrypt(Byte[])

    Encrypt a symmetric transaction key with this RSA key.

    Declaration
    public byte[] Encrypt(byte[] vbInput)
    Parameters
    Type Name Description
    System.Byte[] vbInput

    The symmetric transaction key to be encrypted.

    Returns
    Type Description
    System.Byte[]
    Remarks

    This is a low level method that is not usually called by application code!

    FromJson(JsonObject)

    Initializes an EbicsPubKeyInfo-object from its json representation. FromJson(JsonObject).

    Declaration
    public void FromJson(JsonObject jsonObject)
    Parameters
    Type Name Description
    JsonObject jsonObject

    GetFingerprint(Boolean)

    Computes the fingerprint hash value for the printed Ini Letter. This is the same than calling GetPubKeyDigest(Boolean).

    Declaration
    public byte[] GetFingerprint(bool fFromCertificate)
    Parameters
    Type Name Description
    System.Boolean fFromCertificate

    For EBICS 3.0 or French EBICS systems, this must be true in order to create a fingerprint based on the certificate instead of the public key data.

    Returns
    Type Description
    System.Byte[]
    See Also
    UsesCertificates

    GetPubKeyDigest(Boolean)

    Computes the official digest value for this public key.

    Declaration
    public EbicsDataBuffer GetPubKeyDigest(bool fFromCertificate)
    Parameters
    Type Name Description
    System.Boolean fFromCertificate

    For EBICS 3.0 or French EBICS systems, this must be true in order to create a digest based on the certificate instead of the public key data.

    Returns
    Type Description
    EbicsDataBuffer
    Remarks

    There was some confusion on how the public bank key digest shall be computed in EBICS 3.0. In the original EBICS 3.0 specification it was defined, hence many systems did use the old EBICS 2.5 method of computing it. Since EBICS 3.0.1 it is now explicitly specified, that the digest shall be computed over the certificate data and not the key data. For this reasons most, but not all, EBICS servers accept both digest values. The EbicsTransaction builds the public bank key digest based on the value of UsesCertificates.

    Exceptions
    Type Condition
    System.InvalidOperationException
    See Also
    UsesCertificates

    ParseXml(XmlElement, EbicsVersion)

    Declaration
    public override void ParseXml(XmlElement xmlElement, EbicsVersion nVersion)
    Parameters
    Type Name Description
    System.Xml.XmlElement xmlElement
    EbicsVersion nVersion
    Overrides
    EbicsElement.ParseXml(XmlElement, EbicsVersion)

    ToJson(JsonObject)

    Converts an EbicsPubKeyInfo-object to its json representation. ToJson(JsonObject).

    Declaration
    public JsonObject ToJson(JsonObject jsonObject)
    Parameters
    Type Name Description
    JsonObject jsonObject
    Returns
    Type Description
    JsonObject

    ValidateKeys()

    Checks whether the RSA keys lengths match the required key lengths according to the Version.

    Declaration
    public bool ValidateKeys()
    Returns
    Type Description
    System.Boolean

    If an existing security version was chosen and both key parts are present and have the correct length, then true is returned. In any other case false is returned.

    Verify(Byte[], Byte[])

    Verify a signature with this key.

    Declaration
    public bool Verify(byte[] vbSignature, byte[] vbHash)
    Parameters
    Type Name Description
    System.Byte[] vbSignature

    The raw RSA signature value as a byte array in big endian order.

    System.Byte[] vbHash

    The raw computed hash value as a byte array.

    Returns
    Type Description
    System.Boolean
    Remarks

    This is a low level method that is not usually called by application code!

    Implements

    IEbicsJsonConverter

    Extension Methods

    EbicsJsonConverterExtensions.ToJson(IEbicsJsonConverter)
    In This Article
    Back to top Copyright 2009-2025 Subsembly GmbH