PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
  Classes of Jan Altensen  >  PHP DNSSEC Library  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: example
Class: PHP DNSSEC Library
Validate DNSSEC keys and calculate the DS record
Author: By
Last change: add missing use statement
Date: 4 years ago
Size: 2,420 bytes
 

 

Contents

Class file image Download
<?php
/*
root@Debian-70-wheezy-64-minimal ~ # dig de. DS

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> de. DS
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40982
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;de. IN DS

;; ANSWER SECTION:
de. 14465 IN DS 24220 8 2 FFE926ACA67ED94089390250F1F294AC84A6D84F9121DF73A79E439F 42E820C2

;; Query time: 25 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Feb 26 00:07:53 2015
;; MSG SIZE rcvd: 68



root@Debian-70-wheezy-64-minimal ~ # dig de. DNSKEY

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> de. DNSKEY
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18272
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;de. IN DNSKEY

;; ANSWER SECTION:
de. 5466 IN DNSKEY 256 3 8 AwEAAZnL40PVuGKi8ZK0OhSp8DJ8I/FXtNk4SgWqudiPXlvMg623wdwq Zy9tug05Xf+dRjOOfKuDuRsN4Eo/P3pFWLi+GQmyrqw5huMIrT//SIuN zsdfxsXL4KBNskJdRO7FLJ3ILyoN0xkL8gN0A9hnPR44tlV7d8kOnrod pFCQx4Ov
de. 5466 IN DNSKEY 257 3 8 AwEAAYbcKo2IA8l6arSIiSC+l97v2vgNXrxjBJK+XkX5FYMPDfr2QgtU MHfjLPfMKiSxEXT0uL+SucI1ohv5I0C/pgz9e9NFDhMCpHLPA5s9LIzQ MHEs7Y+idlsRnBKe9Kw/B1RxzSZKxMd8UyAeA6j0vlZIKrokc1nr4ouv DhoYR3JDd7vCcvV08EIuaPgL0ijUYk071OOjRFG+waRZnVPAwFZsgDIg BJqDl/nRVRBI8k3YFVPka6Rls/EIDYloqG+X5VZC/VXbBb7fams8misz 3MsLeVy/fiH0j8SJMAZSbQxqo+/zWUJogl4Tyb5TbT1LRTfbyxII2zQ/ ATXocWOohSU=

;; Query time: 37 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Feb 26 00:08:05 2015
;; MSG SIZE rcvd: 444


*/
use dns\util\DNSSECUtil;
require_once(
'DNSSECUtil.class.php');
var_dump(DNSSECUtil::calculateDS('de.', 8, 'AwEAAYbcKo2IA8l6arSIiSC+l97v2vgNXrxjBJK+XkX5FYMPDfr2QgtU MHfjLPfMKiSxEXT0uL+SucI1ohv5I0C/pgz9e9NFDhMCpHLPA5s9LIzQ MHEs7Y+idlsRnBKe9Kw/B1RxzSZKxMd8UyAeA6j0vlZIKrokc1nr4ouv DhoYR3JDd7vCcvV08EIuaPgL0ijUYk071OOjRFG+waRZnVPAwFZsgDIg BJqDl/nRVRBI8k3YFVPka6Rls/EIDYloqG+X5VZC/VXbBb7fams8misz 3MsLeVy/fiH0j8SJMAZSbQxqo+/zWUJogl4Tyb5TbT1LRTfbyxII2zQ/ ATXocWOohSU='));

/*
array(2) {
  ["sha1"]=>
  string(40) "50D660956B2DFC9F04470D3AD88244F4192F2C98"
  ["sha256"]=>
  string(64) "FFE926ACA67ED94089390250F1F294AC84A6D84F9121DF73A79E439F42E820C2"
}
*/