Exemplo n.º 1
0
 /// <summary>
 /// Create a new case insensitive authorization identifier.
 /// </summary>
 /// <param name="additionalIdToken">This field specifies the additional IdToken.</param>
 /// <param name="type">This defines the type of the additionalIdToken. This is a custom type, so the implementation needs to be agreed upon by all involved parties.</param>
 /// <param name="customData">An optional custom data object to allow to store any kind of customer specific data.</param>
 public AdditionalInfo(string additionalIdToken, string type, CustomData customData = null)
 {
     AdditionalIdToken = additionalIdToken?.Trim() ?? throw new ArgumentNullException(nameof(AdditionalIdToken), "The given additional identification token must not be null or empty!");
     Type       = type?.Trim() ?? throw new ArgumentNullException(nameof(Type), "The given type must not be null or empty!");
     CustomData = customData;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create an authorize request.
 /// </summary>
 /// <param name="idToken">The identifier that needs to be authorized.</param>
 /// <param name="certificate">An optional X.509 certificated presented by the electric vehicle/user (PEM format).</param>
 /// <param name="iso15118CertificateHashData">Optional information to verify the electric vehicle/user contract certificate via OCSP.</param>
 /// <param name="customData">The custom data object to allow to store any kind of customer specific data.</param>
 public AuthorizeRequest(IdToken idToken, string certificate = null, ICollection <OCSPRequestData> iso15118CertificateHashData = null, CustomData customData = null)
 {
     IdToken     = idToken ?? throw new ArgumentNullException(nameof(idToken), "The identification token must not be null!");
     Certificate = certificate;
     Iso15118CertificateHashData = iso15118CertificateHashData ?? new OCSPRequestData[0];
     CustomData = customData;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new status information about an identifier.
 /// </summary>
 /// <param name="status">The authorization status.</param>
 /// <param name="chargingPriority">The optional charging priority from a business point of view, ranging from -9 to 9 with a default value of 0. Higher values indicate a higher priority.</param>
 /// <param name="cacheExpiryDateTime">The optional timestamp after which the token must be considered invalid.</param>
 /// <param name="evseIds">The identification token is only valid fot the given optional enumeration of EVSE identifications.</param>
 /// <param name="groupIdToken">Additional identification token.</param>
 /// <param name="language1">The first optional preferred user interface language of identifier user.</param>
 /// <param name="language2">The second optional preferred user interface language of identifier user.</param>
 /// <param name="personalMessage">An optional message to be displayed at a charging station.</param>
 /// <param name="customData">An optional custom data object to allow to store any kind of customer specific data.</param>
 public IdTokenInfo(AuthorizationStatus status = AuthorizationStatus.Unknown, int chargingPriority = 0, DateTime?cacheExpiryDateTime = null, ICollection <int> evseIds = null, IdToken groupIdToken = null, string language1 = null, string language2 = null, MessageContent personalMessage = null, CustomData customData = null)
 {
     Status              = status;
     ChargingPriority    = chargingPriority;
     CacheExpiryDateTime = cacheExpiryDateTime;
     EvseIds             = evseIds ?? new int[0];
     GroupIdToken        = groupIdToken;
     Language1           = language1;
     Language2           = language2;
     PersonalMessage     = personalMessage;
     CustomData          = customData;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create an authorize response.
 /// </summary>
 /// <param name="request">The authorize request leading to this response.</param>
 /// <param name="idTokenInfo">The identification token info.</param>
 /// <param name="customData">An optional custom data object to allow to store any kind of customer specific data.</param>
 public AuthorizeResponse(AuthorizeRequest request, IdTokenInfo idTokenInfo, CustomData customData = null) : base(request, Result.OK())
 {
     IdTokenInfo = idTokenInfo;
     CustomData  = customData;
 }