Class Endorsement
- Namespace
- MarymoorStudios.Core.Rpc.Identity
- Assembly
- MarymoorStudios.Core.Rpc.Identity.dll
[DataContract]
public sealed class Endorsement
- Inheritance
-
Endorsement
- Inherited Members
Constructors
Endorsement(string, ReadOnlyMemory<byte>, DateTime, string, ReadOnlyMemory<byte>, ReadOnlyMemory<byte>, Claim[])
public Endorsement(string email, ReadOnlyMemory<byte> publicKey, DateTime created, string issuer, ReadOnlyMemory<byte> issuerPublicKey, ReadOnlyMemory<byte> signature, Claim[] claims)
Parameters
emailstringpublicKeyReadOnlyMemory<byte>createdDateTimeissuerstringissuerPublicKeyReadOnlyMemory<byte>signatureReadOnlyMemory<byte>claimsClaim[]
Properties
Claims
An (optional) set of additional claims.
[DataMember]
public Claim[] Claims { get; }
Property Value
- Claim[]
Created
Date the endorsement was created.
[DataMember]
public DateTime Created { get; }
Property Value
Email address of the endorsed identity.
[DataMember]
public string Email { get; }
Property Value
Issuer
Email address of the issuing identity.
[DataMember]
public string Issuer { get; }
Property Value
IssuerPublicKey
Public key of the issuing identity.
[DataMember]
public ReadOnlyMemory<byte> IssuerPublicKey { get; }
Property Value
PublicKey
Public key of the endorsed identity.
[DataMember]
public ReadOnlyMemory<byte> PublicKey { get; }
Property Value
Signature
The signed hash.
[DataMember]
public ReadOnlyMemory<byte> Signature { get; }
Property Value
Methods
PublicKeyEquals(Endorsement, Endorsement)
Returns true if the two endorsements have the same public keys.
public static bool PublicKeyEquals(Endorsement e1, Endorsement e2)
Parameters
e1Endorsemente2Endorsement
Returns
TryCreate(CertificateManager, UserIdentity, DateTime, Claim[], out Endorsement)
Creates an endorsement for a given identity.
public static bool TryCreate(CertificateManager issuer, UserIdentity target, DateTime timestamp, Claim[] claims, out Endorsement endorsement)
Parameters
issuerCertificateManagerThe identity issuing the endorsement.
targetUserIdentityThe identity to be endorsed.
timestampDateTimeThe timestamp to use for the creation time.
claimsClaim[]An (optional) set of additional claims.
endorsementEndorsementIf successful, the endorsement.
Returns
- bool
True is successful, false otherwise.
Remarks
The issuer MUST include a private key.
TryCreate(CertificateManager, UserIdentity, DateTime, out Endorsement)
Creates an endorsement for a given identity.
public static bool TryCreate(CertificateManager issuer, UserIdentity target, DateTime timestamp, out Endorsement endorsement)
Parameters
issuerCertificateManagerThe identity issuing the endorsement.
targetUserIdentityThe identity to be endorsed.
timestampDateTimeThe timestamp to use for the creation time.
endorsementEndorsementIf successful, the endorsement.
Returns
- bool
True is successful, false otherwise.
Remarks
The issuer MUST include a private key.
Validate(CertificateManager)
Validates an endorsement.
public bool Validate(CertificateManager certMgr)
Parameters
certMgrCertificateManager
Returns
- bool
True if the endorsement is valid, false otherwise.