Files
UA-.NETStandard/SampleApplications/Samples/GDS/ServerCommon/ICertificateRequest.cs
T

98 lines
3.2 KiB
C#

/* ========================================================================
* Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
namespace Opc.Ua.Gds.Server
{
public enum CertificateRequestState
{
New,
Approved,
Rejected,
Accepted
}
/// <summary>
/// An abstract interface to the application database
/// </summary>
public interface ICertificateRequest
{
void Initialize();
ushort NamespaceIndex { get; set; }
NodeId StartSigningRequest(
NodeId applicationId,
string certificateGroupId,
string certificateTypeId,
byte[] certificateRequest,
string authorityId);
NodeId StartNewKeyPairRequest(
NodeId applicationId,
string certificateGroupId,
string certificateTypeId,
string subjectName,
string[] domainNames,
string privateKeyFormat,
string privateKeyPassword,
string authorityId);
void ApproveRequest(
NodeId requestId,
bool isRejected);
void AcceptRequest(
NodeId requestId,
byte [] certificate);
CertificateRequestState FinishRequest(
NodeId applicationId,
NodeId requestId,
out string certificateGroupId,
out string certificateTypeId,
out byte[] signedCertificate,
out byte[] privateKey
);
CertificateRequestState ReadRequest(
NodeId applicationId,
NodeId requestId,
out string certificateGroupId,
out string certificateTypeId,
out byte[] certificateRequest,
out string subjectName,
out string[] domainNames,
out string privateKeyFormat,
out string privateKeyPassword);
}
}