public DeviceHSMX509StoreTests(ITestOutputHelper log) { this.log = log; this.deviceHSM = new DeviceHSM(); this.chain = new X509Certificate2Collection( X509CertificateOperations .CreateChainRequest( "CN=Fabrikam CA Root (Integration Test Use Only), O=Fabrikam Drone Delivery", RSA.Create(3072), HashAlgorithmName.SHA512, true, null) .CreateX509SelfSignedCert( 2)); this.leaf = X509CertificateOperations .CreateChainRequest( "CN=Fabrikam Leaf (Integration Test Use Only), O=Fabrikam Drone Delivery", this.deviceHSM.GetPublicKey, HashAlgorithmName.SHA256, false, null) .CreateX509Cert( this.chain[0], 1); this.ca = new Mock <ICertificateAuthority>(); }
public CertificateAuthorityTests(ITestOutputHelper log) { this.log = log; this.config = new Mock <IConfig>(); this.config.Setup(c => c.IoTCompanyName).Returns("company-x"); this.config.Setup(c => c.IoTHardwareIntegratorName) .Returns("factory-y"); this.deviceHSM = new DeviceHSM(); DateTimeOffset now = DateTimeOffset.UtcNow; this.Chain = new X509Certificate2Collection(X509CertificateOperations .CreateChainRequest("CN=rootCATests", RSA.Create(3072), HashAlgorithmName.SHA512, true, null) .CreateSelfSigned(now, now.AddDays(2))); this.leafCsr = X509CertificateOperations .CreateChainRequest("CN=leafCATests", this.deviceHSM.GetPublicKey, HashAlgorithmName.SHA256, false, null); }