public async Task TestSshFpRecord()
        {
            await InitializeZone();

            SshfpFingerprintType fptypeA    = SshfpFingerprintType.SHA1;
            SshfpAlgorithm       algorithmA = SshfpAlgorithm.RSA;
            string valueA = "7E7A55CEA3B8E15528665A6781CA7C35190CF0EB";

            SshfpFingerprintType fptypeB    = SshfpFingerprintType.SHA1;
            SshfpAlgorithm       algorithmB = SshfpAlgorithm.DSA;
            string valueB = "CC17F14DA60CF38E809FE58B10D0F22680D59D08";

            // Create
            long?id = await _client.RecordsAddSshfp(TestZoneName, TestRecordName, 300, valueA, algorithmA, fptypeA);

            Assert.NotNull(id);
            Assert.True(await TestExistence(TestRecordName, RecordType.SSHFP, valueA));

            // Alter
            bool altered = await _client.RecordsAlterSshfp(TestZoneName, id.Value, TestRecordName, 300, valueB, algorithmB, fptypeB);

            Assert.True(altered);
            Assert.True(await TestExistence(TestRecordName, RecordType.SSHFP, valueB));

            // Delete
            bool deleted = await _client.RecordsDelete(TestZoneName, id.Value);

            Assert.True(deleted);
            Assert.False(await TestExistence(TestRecordName, RecordType.SSHFP));
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="info">The information.</param>
 /// <param name="algorithm">The algorithm.</param>
 /// <param name="fingerprintType">The fingerprint type.</param>
 /// <param name="fingerprint">The fingerprint.</param>
 public SshfpRecord(ResourceRecordInfo info, SshfpAlgorithm algorithm, SshfpFingerprintType fingerprintType, string fingerprint) : base(info)
 {
     Algorithm       = algorithm;
     FingerprintType = fingerprintType;
     Fingerprint     = fingerprint;
 }
Exemple #3
0
        public async Task <long?> RecordsAddSshfp(string domainName, string host, int ttl, string value, SshfpAlgorithm algorithm, SshfpFingerprintType fptype)
        {
            QueryStringParameters nvc = new QueryStringParameters();

            nvc["domain-name"] = domainName;
            nvc["host"]        = host;
            nvc["ttl"]         = ttl.ToString();
            nvc["record"]      = value;
            nvc["algorithm"]   = ((int)algorithm).ToString();
            nvc["fptype"]      = ((int)fptype).ToString();
            nvc["record-type"] = RecordType.SSHFP.ToString();

            StatusMessage status = await ExecuteGet <StatusMessage>("/dns/add-record.json", nvc).ConfigureAwait(false);

            if (status.Status == "Failed")
            {
                throw new Exception(status.StatusDescription);
            }

            return(status.Status == "Success" ? status.Data["id"] as long? : null);
        }