Major update: refactored the API of all classes to make attributes start with a lower case letter and rename encode=>to_ccnb() and decode()=>from_ccnb.
(according to the API notes: http://sea.remap.ucla.edu:8080/attachments/download/23/lwndn_api-notes_21020830.txt )
diff --git a/js/ContentName.js b/js/ContentName.js
index 59a9b94..249cfbe 100644
--- a/js/ContentName.js
+++ b/js/ContentName.js
@@ -9,16 +9,16 @@
if( typeof _components == 'string') {
if(LOG>3)console.log('Content Name String '+_components);
- this.Components = ContentName.makeBlob(ContentName.createNameArray(_components));
+ this.components = ContentName.makeBlob(ContentName.createNameArray(_components));
}
else if(typeof _components === 'object' && _components instanceof Array ){
if(LOG>4)console.log('Content Name Array '+_components);
- this.Components = ContentName.makeBlob(_components);
+ this.components = ContentName.makeBlob(_components);
}
else if(_components==null){
- this.Components =[];
+ this.components =[];
}
else{
@@ -31,8 +31,8 @@
var output = "";
- for(var i=0;i<this.Components.length;i++){
- output+= "/"+ DataUtils.toString(this.Components[i]);
+ for(var i=0;i<this.components.length;i++){
+ output+= "/"+ DataUtils.toString(this.components[i]);
}
return output;
@@ -73,11 +73,11 @@
}
-ContentName.prototype.decode = function(/*XMLDecoder*/ decoder) {
+ContentName.prototype.from_ccnb = function(/*XMLDecoder*/ decoder) {
decoder.readStartElement(this.getElementLabel());
- this.Components = new Array(); //new ArrayList<byte []>();
+ this.components = new Array(); //new ArrayList<byte []>();
while (decoder.peekStartElement(CCNProtocolDTags.Component)) {
this.add(decoder.readBinaryElement(CCNProtocolDTags.Component));
@@ -86,15 +86,15 @@
decoder.readEndElement();
};
-ContentName.prototype.encode = function(/*XMLEncoder*/ encoder) {
+ContentName.prototype.to_ccnb = function(/*XMLEncoder*/ encoder) {
- if( this.Components ==null )
+ if( this.components ==null )
throw new Exception("CANNOT ENCODE EMPTY CONTENT NAME");
encoder.writeStartElement(this.getElementLabel());
- var count = this.Components.length;
+ var count = this.components.length;
for (var i=0; i < count; i++) {
- encoder.writeElement(CCNProtocolDTags.Component, this.Components[i]);
+ encoder.writeElement(CCNProtocolDTags.Component, this.components[i]);
}
encoder.writeEndElement();
};
@@ -104,6 +104,6 @@
};
ContentName.prototype.add = function(param){
- return this.Components.push(param);
+ return this.components.push(param);
};
diff --git a/js/ContentObject.js b/js/ContentObject.js
index 5ac4d28..eb5db79 100644
--- a/js/ContentObject.js
+++ b/js/ContentObject.js
@@ -12,9 +12,9 @@
//TODO Check the class of _name
this.name = _name;
}
- this.SignedInfo = _signedInfo;
+ this.signedInfo = _signedInfo;
this.content=_content;
- this.Signature = _signature;
+ this.signature = _signature;
this.startSIG = null;
@@ -29,7 +29,7 @@
ContentObject.prototype.sign = function(){
var n1 = this.encodeObject(this.name);
- var n2 = this.encodeObject(this.SignedInfo);
+ var n2 = this.encodeObject(this.signedInfo);
var n3 = this.encodeContent();
var n = n1.concat(n2,n3);
@@ -58,7 +58,7 @@
if(LOG>2)console.log( DataUtils.toNumbers(hSig.trim()));
- this.Signature.Signature = DataUtils.toNumbers(hSig.trim());
+ this.signature.signature = DataUtils.toNumbers(hSig.trim());
};
@@ -66,7 +66,7 @@
ContentObject.prototype.encodeObject = function encodeObject(obj){
var enc = new BinaryXMLEncoder();
- obj.encode(enc);
+ obj.to_ccnb(enc);
var num = enc.getReducedOstream();
@@ -102,8 +102,8 @@
if( decoder.peekStartElement(CCNProtocolDTags.Signature) ){
- this.Signature = new Signature();
- this.Signature.decode(decoder);
+ this.signature = new Signature();
+ this.signature.from_ccnb(decoder);
}
//this.endSIG = decoder.offset;
@@ -111,14 +111,14 @@
this.startSIG = decoder.offset;
this.name = new ContentName();
- this.name.decode(decoder);
+ this.name.from_ccnb(decoder);
//this.startSignedInfo = decoder.offset;
if( decoder.peekStartElement(CCNProtocolDTags.SignedInfo) ){
- this.SignedInfo = new SignedInfo();
- this.SignedInfo.decode(decoder);
+ this.signedInfo = new SignedInfo();
+ this.signedInfo.from_ccnb(decoder);
}
this.content = decoder.readBinaryElement(CCNProtocolDTags.Content);
@@ -143,19 +143,19 @@
- if(null!=this.Signature) this.Signature.encode(encoder);
+ if(null!=this.signature) this.signature.to_ccnb(encoder);
this.startSIG = encoder.offset;
- if(null!=this.name) this.name.encode(encoder);
+ if(null!=this.name) this.name.to_ccnb(encoder);
//this.endSIG = encoder.offset;
//this.startSignedInfo = encoder.offset;
- if(null!=this.SignedInfo) this.SignedInfo.encode(encoder);
+ if(null!=this.signedInfo) this.signedInfo.to_ccnb(encoder);
encoder.writeElement(CCNProtocolDTags.Content, this.content);
diff --git a/js/Exclude.js b/js/Exclude.js
index 50f8ea7..1ee9112 100644
--- a/js/Exclude.js
+++ b/js/Exclude.js
@@ -3,16 +3,16 @@
* This class represents Exclude objects
*/
-var Exclude = function Exclude(_Values){
+var Exclude = function Exclude(_values){
this.OPTIMUM_FILTER_SIZE = 100;
- this.Values = _Values; //array of elements
+ this.values = _values; //array of elements
}
-Exclude.prototype.decode = function(/*XMLDecoder*/ decoder) {
+Exclude.prototype.from_ccnb = function(/*XMLDecoder*/ decoder) {
@@ -35,7 +35,7 @@
};
-Exclude.prototype.encode=function(/*XMLEncoder*/ encoder) {
+Exclude.prototype.to_ccnb=function(/*XMLEncoder*/ encoder) {
if (!validate()) {
throw new ContentEncodingException("Cannot encode " + this.getClass().getName() + ": field values missing.");
}
diff --git a/js/ExcludeAny.js b/js/ExcludeAny.js
index 25a1a23..7986cba 100644
--- a/js/ExcludeAny.js
+++ b/js/ExcludeAny.js
@@ -7,13 +7,13 @@
};
-ExcludeAny.prototype.decode = function(decoder) {
+ExcludeAny.prototype.from_ccnb = function(decoder) {
decoder.readStartElement(this.getElementLabel());
decoder.readEndElement();
};
-ExcludeAny.prototype.encode = function( encoder) {
+ExcludeAny.prototype.to_ccnb = function( encoder) {
encoder.writeStartElement(this.getElementLabel());
encoder.writeEndElement();
};
diff --git a/js/ExcludeComponent.js b/js/ExcludeComponent.js
index ed2bbeb..d723d93 100644
--- a/js/ExcludeComponent.js
+++ b/js/ExcludeComponent.js
@@ -3,19 +3,19 @@
* This class represents Exclude Component OBjects
*/
-var ExcludeComponent = function ExcludeComponent(_Body) {
+var ExcludeComponent = function ExcludeComponent(_body) {
//TODO Check BODY is an Array of componenets.
- this.Body = _Body
+ this.body = _body
};
-ExcludeComponent.prototype.decode = function( decoder) {
- body = decoder.readBinaryElement(this.getElementLabel());
+ExcludeComponent.prototype.from_ccnb = function( decoder) {
+ this.body = decoder.readBinaryElement(this.getElementLabel());
};
-ExcludeComponent.prototype.encode = function(encoder) {
- encoder.writeElement(this.getElementLabel(), body);
+ExcludeComponent.prototype.to_ccnb = function(encoder) {
+ encoder.writeElement(this.getElementLabel(), this.body);
};
ExcludeComponent.prototype.getElementLabel = function() { return CCNProtocolDTags.Component; };
diff --git a/js/FaceInstance.js b/js/FaceInstance.js
index 5cac6bc..78ac5de 100644
--- a/js/FaceInstance.js
+++ b/js/FaceInstance.js
@@ -6,36 +6,36 @@
var NetworkProtocol = { TCP:6, UDP:17};
var FaceInstance = function FaceInstance(
- _Action,
- _PublisherPublicKeyDigest,
- _FaceID,
- _IPProto,
- _Host,
- _Port,
- _MulticastInterface,
- _MulticastTTL,
- _FreshnessSeconds){
+ _action,
+ _publisherPublicKeyDigest,
+ _faceID,
+ _ipProto,
+ _host,
+ _port,
+ _multicastInterface,
+ _multicastTTL,
+ _freshnessSeconds){
- this.Action = _Action;
- this.PublisherPublicKeyDigest = _PublisherPublicKeyDigest;
- this.FaceID = _FaceID;
- this.IPProto = _IPProto;
- this.Host = _Host;
- this.Port = _Port;
- this.MulticastInterface =_MulticastInterface;
- this.MulticastTTL =_MulticastTTL;
- this.FreshnessSeconds = _FreshnessSeconds;
+ this.action = _action;
+ this.publisherPublicKeyDigest = _publisherPublicKeyDigest;
+ this.faceID = _faceID;
+ this.ipProto = _ipProto;
+ this.host = _host;
+ this.Port = _port;
+ this.multicastInterface =_multicastInterface;
+ this.multicastTTL =_multicastTTL;
+ this.freshnessSeconds = _freshnessSeconds;
- //Action ::= ("newface" | "destroyface" | "queryface")
- //PublisherPublicKeyDigest ::= SHA-256 digest
- //FaceID ::= nonNegativeInteger
- //IPProto ::= nonNegativeInteger [IANA protocol number, 6=TCP, 17=UDP]
+ //action ::= ("newface" | "destroyface" | "queryface")
+ //publisherPublicKeyDigest ::= SHA-256 digest
+ //faceID ::= nonNegativeInteger
+ //ipProto ::= nonNegativeInteger [IANA protocol number, 6=TCP, 17=UDP]
//Host ::= textual representation of numeric IPv4 or IPv6 address
//Port ::= nonNegativeInteger [1..65535]
//MulticastInterface ::= textual representation of numeric IPv4 or IPv6 address
//MulticastTTL ::= nonNegativeInteger [1..255]
- //FreshnessSeconds ::= nonNegativeInteger
+ //freshnessSeconds ::= nonNegativeInteger
};
@@ -43,25 +43,25 @@
* Used by NetworkObject to decode the object from a network stream.
* @see org.ccnx.ccn.impl.encoding.XMLEncodable
*/
-FaceInstance.prototype.decode = function(//XMLDecoder
+FaceInstance.prototype.from_ccnb = function(//XMLDecoder
decoder) {
decoder.readStartElement(this.getElementLabel());
if (decoder.peekStartElement(CCNProtocolDTags.Action)) {
- this.Action = decoder.readUTF8Element(CCNProtocolDTags.Action);
+ this.action = decoder.readUTF8Element(CCNProtocolDTags.Action);
}
if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
- this.PublisherPublicKeyDigest = new PublisherPublicKeyDigest();
- this.PublisherPublicKeyDigest.decode(decoder);
+ this.publisherPublicKeyDigest = new PublisherPublicKeyDigest();
+ this.publisherPublicKeyDigest.from_ccnb(decoder);
}
if (decoder.peekStartElement(CCNProtocolDTags.FaceID)) {
- this.FaceID = decoder.readIntegerElement(CCNProtocolDTags.FaceID);
+ this.faceID = decoder.readIntegerElement(CCNProtocolDTags.FaceID);
}
if (decoder.peekStartElement(CCNProtocolDTags.IPProto)) {
@@ -69,15 +69,15 @@
//int
var pI = decoder.readIntegerElement(CCNProtocolDTags.IPProto);
- this.IPProto = null;
+ this.ipProto = null;
if (NetworkProtocol.TCP == pI) {
- this.IPProto = NetworkProtocol.TCP;
+ this.ipProto = NetworkProtocol.TCP;
} else if (NetworkProtocol.UDP == pI) {
- this.IPProto = NetworkProtocol.UDP;
+ this.ipProto = NetworkProtocol.UDP;
} else {
@@ -89,7 +89,7 @@
if (decoder.peekStartElement(CCNProtocolDTags.Host)) {
- this.Host = decoder.readUTF8Element(CCNProtocolDTags.Host);
+ this.host = decoder.readUTF8Element(CCNProtocolDTags.Host);
}
@@ -98,15 +98,15 @@
}
if (decoder.peekStartElement(CCNProtocolDTags.MulticastInterface)) {
- this.MulticastInterface = decoder.readUTF8Element(CCNProtocolDTags.MulticastInterface);
+ this.multicastInterface = decoder.readUTF8Element(CCNProtocolDTags.MulticastInterface);
}
if (decoder.peekStartElement(CCNProtocolDTags.MulticastTTL)) {
- this.MulticastTTL = decoder.readIntegerElement(CCNProtocolDTags.MulticastTTL);
+ this.multicastTTL = decoder.readIntegerElement(CCNProtocolDTags.MulticastTTL);
}
if (decoder.peekStartElement(CCNProtocolDTags.FreshnessSeconds)) {
- this.FreshnessSeconds = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds);
+ this.freshnessSeconds = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds);
}
decoder.readEndElement();
}
@@ -115,7 +115,7 @@
* Used by NetworkObject to encode the object to a network stream.
* @see org.ccnx.ccn.impl.encoding.XMLEncodable
*/
-FaceInstance.prototype.encode = function(//XMLEncoder
+FaceInstance.prototype.to_ccnb = function(//XMLEncoder
encoder){
//if (!this.validate()) {
@@ -124,33 +124,33 @@
//}
encoder.writeStartElement(this.getElementLabel());
- if (null != this.Action && this.Action.length != 0)
- encoder.writeElement(CCNProtocolDTags.Action, this.Action);
+ if (null != this.action && this.action.length != 0)
+ encoder.writeElement(CCNProtocolDTags.Action, this.action);
- if (null != this.PublisherPublicKeyDigest) {
- this.PublisherPublicKeyDigest.encode(encoder);
+ if (null != this.publisherPublicKeyDigest) {
+ this.publisherPublicKeyDigest.to_ccnb(encoder);
}
- if (null != this.FaceID) {
- encoder.writeElement(CCNProtocolDTags.FaceID, this.FaceID);
+ if (null != this.faceID) {
+ encoder.writeElement(CCNProtocolDTags.FaceID, this.faceID);
}
- if (null != this.IPProto) {
+ if (null != this.ipProto) {
//encoder.writeElement(CCNProtocolDTags.IPProto, this.IpProto.value());
- encoder.writeElement(CCNProtocolDTags.IPProto, this.IPProto);
+ encoder.writeElement(CCNProtocolDTags.IPProto, this.ipProto);
}
- if (null != this.Host && this.Host.length != 0) {
- encoder.writeElement(CCNProtocolDTags.Host, this.Host);
+ if (null != this.host && this.host.length != 0) {
+ encoder.writeElement(CCNProtocolDTags.Host, this.host);
}
if (null != this.Port) {
encoder.writeElement(CCNProtocolDTags.Port, this.Port);
}
- if (null != this.MulticastInterface && this.MulticastInterface.length != 0) {
- encoder.writeElement(CCNProtocolDTags.MulticastInterface, this.MulticastInterface);
+ if (null != this.multicastInterface && this.multicastInterface.length != 0) {
+ encoder.writeElement(CCNProtocolDTags.MulticastInterface, this.multicastInterface);
}
- if (null != this.MulticastTTL) {
- encoder.writeElement(CCNProtocolDTags.MulticastTTL, this.MulticastTTL);
+ if (null != this.multicastTTL) {
+ encoder.writeElement(CCNProtocolDTags.MulticastTTL, this.multicastTTL);
}
- if (null != this.FreshnessSeconds) {
- encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.FreshnessSeconds);
+ if (null != this.freshnessSeconds) {
+ encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.freshnessSeconds);
}
encoder.writeEndElement();
}
diff --git a/js/ForwardingEntry.js b/js/ForwardingEntry.js
index 60fe750..4f04478 100644
--- a/js/ForwardingEntry.js
+++ b/js/ForwardingEntry.js
@@ -20,45 +20,45 @@
//String
- this.Action = _action;
+ this.action = _action;
//ContentName\
- this.PrefixName = _prefixName;
+ this.prefixName = _prefixName;
//PublisherPublicKeyDigest
- this.CCNID = _ccndId;
+ this.ccndID = _ccndId;
//Integer
- this.FaceID = _faceID;
+ this.faceID = _faceID;
//Integer
- this.Flags = _flags;
+ this.flags = _flags;
//Integer
- this.Lifetime = _lifetime; // in seconds
+ this.lifetime = _lifetime; // in seconds
};
-ForwardingEntry.prototype.decode =function(
+ForwardingEntry.prototype.from_ccnb =function(
//XMLDecoder
decoder)
//throws ContentDecodingException
{
decoder.readStartElement(this.getElementLabel());
if (decoder.peekStartElement(CCNProtocolDTags.Action)) {
- this.Action = decoder.readUTF8Element(CCNProtocolDTags.Action);
+ this.action = decoder.readUTF8Element(CCNProtocolDTags.Action);
}
if (decoder.peekStartElement(CCNProtocolDTags.Name)) {
- this.PrefixName = new ContentName();
- this.PrefixName.decode(decoder) ;
+ this.prefixName = new ContentName();
+ this.prefixName.from_ccnb(decoder) ;
}
if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
this.CcndId = new PublisherPublicKeyDigest();
- this.CcndId.decode(decoder);
+ this.CcndId.from_ccnb(decoder);
}
if (decoder.peekStartElement(CCNProtocolDTags.FaceID)) {
- this.FaceID = decoder.readIntegerElement(CCNProtocolDTags.FaceID);
+ this.faceID = decoder.readIntegerElement(CCNProtocolDTags.FaceID);
}
if (decoder.peekStartElement(CCNProtocolDTags.ForwardingFlags)) {
- this.Flags = decoder.readIntegerElement(CCNProtocolDTags.ForwardingFlags);
+ this.flags = decoder.readIntegerElement(CCNProtocolDTags.ForwardingFlags);
}
if (decoder.peekStartElement(CCNProtocolDTags.FreshnessSeconds)) {
- this.Lifetime = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds);
+ this.lifetime = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds);
}
decoder.readEndElement();
};
@@ -67,7 +67,7 @@
* Used by NetworkObject to encode the object to a network stream.
* @see org.ccnx.ccn.impl.encoding.XMLEncodable
*/
-ForwardingEntry.prototype.encode =function(
+ForwardingEntry.prototype.to_ccnb =function(
//XMLEncoder
encoder)
{
@@ -77,22 +77,22 @@
//throw new ContentEncodingException("Cannot encode " + this.getClass().getName() + ": field values missing.");
//}
encoder.writeStartElement(this.getElementLabel());
- if (null != this.Action && this.Action.length != 0)
- encoder.writeElement(CCNProtocolDTags.Action, this.Action);
- if (null != this.PrefixName) {
- this.PrefixName.encode(encoder);
+ if (null != this.action && this.action.length != 0)
+ encoder.writeElement(CCNProtocolDTags.Action, this.action);
+ if (null != this.prefixName) {
+ this.prefixName.to_ccnb(encoder);
}
if (null != this.CcndId) {
- this.CcndId.encode(encoder);
+ this.CcndId.to_ccnb(encoder);
}
- if (null != this.FaceID) {
- encoder.writeElement(CCNProtocolDTags.FaceID, this.FaceID);
+ if (null != this.faceID) {
+ encoder.writeElement(CCNProtocolDTags.FaceID, this.faceID);
}
- if (null != this.Flags) {
- encoder.writeElement(CCNProtocolDTags.ForwardingFlags, this.Flags);
+ if (null != this.flags) {
+ encoder.writeElement(CCNProtocolDTags.ForwardingFlags, this.flags);
}
- if (null != this.Lifetime) {
- encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.Lifetime);
+ if (null != this.lifetime) {
+ encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.lifetime);
}
encoder.writeEndElement();
};
diff --git a/js/Interest.js b/js/Interest.js
index 46303b1..15fb05a 100644
--- a/js/Interest.js
+++ b/js/Interest.js
@@ -37,7 +37,7 @@
decoder.readStartElement(CCNProtocolDTags.Interest);
this.name = new ContentName();
- this.name.decode(decoder);
+ this.name.from_ccnb(decoder);
if (decoder.peekStartElement(CCNProtocolDTags.MinSuffixComponents)) {
this.minSuffixComponents = decoder.readIntegerElement(CCNProtocolDTags.MinSuffixComponents);
@@ -48,13 +48,13 @@
}
if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
- this.publisherPublicKeyDigest = new PublisherPublicKeyDigest();
- this.publisherPublicKeyDigest.decode(decoder);
+ this.publisherPublicKeyDigest = new publisherPublicKeyDigest();
+ this.publisherPublicKeyDigest.from_ccnb(decoder);
}
if (decoder.peekStartElement(CCNProtocolDTags.Exclude)) {
this.exclude = new Exclude();
- this.exclude.decode(decoder);
+ this.exclude.from_ccnb(decoder);
}
if (decoder.peekStartElement(CCNProtocolDTags.ChildSelector)) {
@@ -86,7 +86,7 @@
encoder.writeStartElement(CCNProtocolDTags.Interest);
- this.name.encode(encoder);
+ this.name.to_ccnb(encoder);
if (null != this.minSuffixComponents)
encoder.writeElement(CCNProtocolDTags.MinSuffixComponents, this.minSuffixComponents);
@@ -95,10 +95,10 @@
encoder.writeElement(CCNProtocolDTags.MaxSuffixComponents, this.maxSuffixComponents);
if (null != this.publisherPublicKeyDigest)
- this.publisherPublicKeyDigest.encode(encoder);
+ this.publisherPublicKeyDigest.to_ccnb(encoder);
if (null != this.exclude)
- this.exclude.encode(encoder);
+ this.exclude.to_ccnb(encoder);
if (null != this.childSelector)
encoder.writeElement(CCNProtocolDTags.ChildSelector, this.childSelector);
@@ -118,8 +118,8 @@
};
Interest.prototype.matches_name = function(/*ContentName*/ name){
- var i_name = this.name.Components;
- var o_name = name.Components;
+ var i_name = this.name.components;
+ var o_name = name.components;
// The intrest name is longer than the name we are checking it against.
if (i_name.length > o_name.length)
diff --git a/js/KeyLocator.js b/js/KeyLocator.js
index 9ada28b..96df104 100644
--- a/js/KeyLocator.js
+++ b/js/KeyLocator.js
@@ -9,24 +9,24 @@
CERTIFICATE:3
};
-var KeyLocator = function KeyLocator(_Input,_Type){
+var KeyLocator = function KeyLocator(_input,_type){
- this.Type=_Type;
+ this.type=_type;
- if (_Type==KeyLocatorType.NAME){
- this.KeyName = _Input;
+ if (_type==KeyLocatorType.NAME){
+ this.keyName = _input;
}
- else if(_Type==KeyLocatorType.KEY){
+ else if(_type==KeyLocatorType.KEY){
console.log('SET KEY');
- this.PublicKey = _Input;
+ this.publicKey = _input;
}
- else if(_Type==KeyLocatorType.CERTIFICATE){
- this.Certificate = _Input;
+ else if(_type==KeyLocatorType.CERTIFICATE){
+ this.certificate = _input;
}
};
-KeyLocator.prototype.decode = function(decoder) {
+KeyLocator.prototype.from_ccnb = function(decoder) {
decoder.readStartElement(this.getElementLabel());
@@ -37,19 +37,19 @@
//TODO FIX THIS, This should create a Key Object instead of keeping bytes
- this.PublicKey = encodedKey;//CryptoUtil.getPublicKey(encodedKey);
- this.Type = 2;
+ this.publicKey = encodedKey;//CryptoUtil.getPublicKey(encodedKey);
+ this.type = 2;
- if(LOG>4) console.log('PUBLIC KEY FOUND: '+ this.PublicKey);
- //this.PublicKey = encodedKey;
+ if(LOG>4) console.log('PUBLIC KEY FOUND: '+ this.publicKey);
+ //this.publicKey = encodedKey;
} catch (e) {
throw new Exception("Cannot parse key: ", e);
}
- if (null == this.PublicKey) {
+ if (null == this.publicKey) {
throw new Exception("Cannot parse key: ");
}
@@ -62,34 +62,34 @@
*/
//CertificateFactory factory = CertificateFactory.getInstance("X.509");
- //this.Certificate = (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(encodedCert));
+ //this.certificate = (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(encodedCert));
- this.Certificate = encodedCert;
- this.Type = 3;
+ this.certificate = encodedCert;
+ this.type = 3;
- if(LOG>4) console.log('CERTIFICATE FOUND: '+ this.Certificate);
+ if(LOG>4) console.log('CERTIFICATE FOUND: '+ this.certificate);
} catch ( e) {
throw new Exception("Cannot decode certificate: " + e);
}
- if (null == this.Certificate) {
+ if (null == this.certificate) {
throw new Exception("Cannot parse certificate! ");
}
} else {
- this.Type = 1;
+ this.type = 1;
- this.KeyName = new KeyName();
- this.KeyName.decode(decoder);
+ this.keyName = new KeyName();
+ this.keyName.from_ccnb(decoder);
}
decoder.readEndElement();
}
- KeyLocator.prototype.encode = function( encoder) {
+ KeyLocator.prototype.to_ccnb = function( encoder) {
- if(LOG>2) console.log('type is is ' + this.Type);
+ if(LOG>2) console.log('type is is ' + this.type);
//TODO Check if Name is missing
if (!this.validate()) {
throw new ContentEncodingException("Cannot encode " + this.getClass().getName() + ": field values missing.");
@@ -99,21 +99,21 @@
//TODO FIX THIS TOO
encoder.writeStartElement(this.getElementLabel());
- if (this.Type == KeyLocatorType.KEY) {
- if(LOG>5)console.log('About to encode a public key' +this.PublicKey);
- encoder.writeElement(CCNProtocolDTags.Key, this.PublicKey);
+ if (this.type == KeyLocatorType.KEY) {
+ if(LOG>5)console.log('About to encode a public key' +this.publicKey);
+ encoder.writeElement(CCNProtocolDTags.Key, this.publicKey);
- } else if (this.Type == KeyLocatorType.CERTIFICATE) {
+ } else if (this.type == KeyLocatorType.CERTIFICATE) {
try {
- encoder.writeElement(CCNProtocolDTags.Certificate, this.Certificate);
+ encoder.writeElement(CCNProtocolDTags.Certificate, this.certificate);
} catch ( e) {
throw new Exception("CertificateEncodingException attempting to write key locator: " + e);
}
- } else if (this.Type == KeyLocatorType.NAME) {
+ } else if (this.type == KeyLocatorType.NAME) {
- this.KeyName.encode(encoder);
+ this.keyName.to_ccnb(encoder);
}
encoder.writeEndElement();
@@ -124,6 +124,6 @@
};
KeyLocator.prototype.validate = function() {
- return ( (null != this.KeyName) || (null != this.PublicKey) || (null != this.Certificate) );
+ return ( (null != this.keyName) || (null != this.publicKey) || (null != this.certificate) );
};
\ No newline at end of file
diff --git a/js/KeyName.js b/js/KeyName.js
index c156af1..e958c3f 100644
--- a/js/KeyName.js
+++ b/js/KeyName.js
@@ -6,40 +6,40 @@
var KeyName = function KeyName() {
- this.ContentName = this.ContentName;//ContentName
- this.PublisherID =this.PublisherID;//PublisherID
+ this.contentName = this.contentName;//contentName
+ this.publisherID =this.publisherID;//publisherID
};
-KeyName.prototype.decode=function( decoder){
+KeyName.prototype.from_ccnb=function( decoder){
decoder.readStartElement(this.getElementLabel());
- this.ContentName = new ContentName();
- this.ContentName.decode(decoder);
+ this.contentName = new ContentName();
+ this.contentName.from_ccnb(decoder);
if(LOG>4) console.log('KEY NAME FOUND: ');
if ( PublisherID.peek(decoder) ) {
- this.PublisherID = new PublisherID();
- this.PublisherID.decode(decoder);
+ this.publisherID = new PublisherID();
+ this.publisherID.from_ccnb(decoder);
}
decoder.readEndElement();
};
-KeyName.prototype.encode = function( encoder) {
+KeyName.prototype.to_ccnb = function( encoder) {
if (!this.validate()) {
throw new Exception("Cannot encode : field values missing.");
}
encoder.writeStartElement(this.getElementLabel());
- this.ContentName.encode(encoder);
- if (null != this.PublisherID)
- this.PublisherID.encode(encoder);
+ this.contentName.to_ccnb(encoder);
+ if (null != this.publisherID)
+ this.publisherID.to_ccnb(encoder);
encoder.writeEndElement();
};
@@ -49,5 +49,5 @@
KeyName.prototype.validate = function() {
// DKS -- do we do recursive validation?
// null signedInfo ok
- return (null != this.ContentName);
+ return (null != this.contentName);
};
diff --git a/js/PublisherID.js b/js/PublisherID.js
index 64955f3..3558d24 100644
--- a/js/PublisherID.js
+++ b/js/PublisherID.js
@@ -34,16 +34,16 @@
//TODO, implement publisherID creation and key creation
//TODO implement generatePublicKeyDigest
- this.PublisherID =null;//= generatePublicKeyDigest(key);//ByteArray
+ this.publisherID =null;//= generatePublicKeyDigest(key);//ByteArray
//TODO implement generate key
//CryptoUtil.generateKeyID(PUBLISHER_ID_DIGEST_ALGORITHM, key);
- this.PublisherType = null;//isIssuer ? PublisherType.ISSUER_KEY : PublisherType.KEY;//publisher Type
+ this.publisherType = null;//isIssuer ? PublisherType.ISSUER_KEY : PublisherType.KEY;//publisher Type
};
-PublisherID.prototype.decode = function(decoder) {
+PublisherID.prototype.from_ccnb = function(decoder) {
// We have a choice here of one of 4 binary element types.
var nextTag = decoder.peekStartElementAsLong();
@@ -52,23 +52,23 @@
throw new Exception("Cannot parse publisher ID.");
}
- this.PublisherType = new PublisherType(nextTag);
+ this.publisherType = new PublisherType(nextTag);
if (!isTypeTagVal(nextTag)) {
throw new Exception("Invalid publisher ID, got unexpected type: " + nextTag);
}
- this.PublisherID = decoder.readBinaryElement(nextTag);
- if (null == this.PublisherID) {
+ this.publisherID = decoder.readBinaryElement(nextTag);
+ if (null == this.publisherID) {
throw new ContentDecodingException("Cannot parse publisher ID of type : " + nextTag + ".");
}
};
-PublisherID.prototype.encode = function(encoder) {
+PublisherID.prototype.to_ccnb = function(encoder) {
if (!this.validate()) {
throw new Exception("Cannot encode " + this.getClass().getName() + ": field values missing.");
}
- encoder.writeElement(this.getElementLabel(), this.PublisherID);
+ encoder.writeElement(this.getElementLabel(), this.publisherID);
};
PublisherID.peek = function(/* XMLDecoder */ decoder) {
@@ -84,7 +84,7 @@
};
PublisherID.prototype.getElementLabel = function() {
- return this.PublisherType.Tag;
+ return this.publisherType.Tag;
};
PublisherID.prototype.validate = function(){
diff --git a/js/PublisherPublicKeyDigest.js b/js/PublisherPublicKeyDigest.js
index a5b400d..50f856c 100644
--- a/js/PublisherPublicKeyDigest.js
+++ b/js/PublisherPublicKeyDigest.js
@@ -8,44 +8,44 @@
this.PUBLISHER_ID_LEN = 512/8;
- this.PublisherPublicKeyDigest = _pkd;
- //if( typeof _pkd == "object") this.PublisherPublicKeyDigest = _pkd; // Byte Array
+ this.publisherPublicKeyDigest = _pkd;
+ //if( typeof _pkd == "object") this.publisherPublicKeyDigest = _pkd; // Byte Array
//else if( typeof _pkd == "PublicKey") ;//TODO...
};
-PublisherPublicKeyDigest.prototype.decode = function( decoder) {
+PublisherPublicKeyDigest.prototype.from_ccnb = function( decoder) {
- this.PublisherPublicKeyDigest = decoder.readBinaryElement(this.getElementLabel());
+ this.publisherPublicKeyDigest = decoder.readBinaryElement(this.getElementLabel());
- if(LOG>4)console.log('Publisher public key digest is ' + this.PublisherPublicKeyDigest);
+ if(LOG>4)console.log('Publisher public key digest is ' + this.publisherPublicKeyDigest);
- if (null == this.PublisherPublicKeyDigest) {
+ if (null == this.publisherPublicKeyDigest) {
throw new Exception("Cannot parse publisher key digest.");
}
//TODO check if the length of the PublisherPublicKeyDigest is correct ( Security reason)
- if (this.PublisherPublicKeyDigest.length != this.PUBLISHER_ID_LEN) {
+ if (this.publisherPublicKeyDigest.length != this.PUBLISHER_ID_LEN) {
- console.log('LENGTH OF PUBLISHER ID IS WRONG! Expected ' + this.PUBLISHER_ID_LEN + ", got " + this.PublisherPublicKeyDigest.length);
+ console.log('LENGTH OF PUBLISHER ID IS WRONG! Expected ' + this.PUBLISHER_ID_LEN + ", got " + this.publisherPublicKeyDigest.length);
- //this.PublisherPublicKeyDigest = new PublisherPublicKeyDigest(this.PublisherPublicKeyDigest).PublisherKeyDigest;
+ //this.publisherPublicKeyDigest = new PublisherPublicKeyDigest(this.PublisherPublicKeyDigest).PublisherKeyDigest;
}
};
-PublisherPublicKeyDigest.prototype.encode= function( encoder) {
+PublisherPublicKeyDigest.prototype.to_ccnb= function( encoder) {
//TODO Check that the ByteArray for the key is present
if (!this.validate()) {
throw new Exception("Cannot encode : field values missing.");
}
- if(LOG>3) console.log('PUBLISHER KEY DIGEST IS'+this.PublisherPublicKeyDigest);
- encoder.writeElement(this.getElementLabel(), this.PublisherPublicKeyDigest);
+ if(LOG>3) console.log('PUBLISHER KEY DIGEST IS'+this.publisherPublicKeyDigest);
+ encoder.writeElement(this.getElementLabel(), this.publisherPublicKeyDigest);
};
PublisherPublicKeyDigest.prototype.getElementLabel = function() { return CCNProtocolDTags.PublisherPublicKeyDigest; };
PublisherPublicKeyDigest.prototype.validate =function() {
- return (null != this.PublisherPublicKeyDigest);
+ return (null != this.publisherPublicKeyDigest);
};
diff --git a/js/Signature.js b/js/Signature.js
index 7eef1d1..9672b3f 100644
--- a/js/Signature.js
+++ b/js/Signature.js
@@ -4,17 +4,17 @@
*/
-var Signature = function Signature(_Witness,_Signature,_DigestAlgorithm) {
+var Signature = function Signature(_witness,_signature,_digestAlgorithm) {
- this.Witness = _Witness;//byte [] _witness;
- this.Signature = _Signature;//byte [] _signature;
- this.DigestAlgorithm = _DigestAlgorithm//String _digestAlgorithm;
+ this.Witness = _witness;//byte [] _witness;
+ this.signature = _signature;//byte [] _signature;
+ this.digestAlgorithm = _digestAlgorithm//String _digestAlgorithm;
};
var generateSignature = function(contentName,content,signedinfo){
var enc = new BinaryXMLEncoder();
- contentName.encode(enc);
+ contentName.to_ccnb(enc);
var hex1 = toHex(enc.getReducedOstream());
var enc = new BinaryXMLEncoder();
@@ -22,7 +22,7 @@
var hex2 = toHex(enc.getReducedOstream());
var enc = new BinaryXMLEncoder();
- signedinfo.encode(enc);
+ signedinfo.to_ccnb(enc);
var hex3 = toHex(enc.getReducedOstream());
var hex = hex1+hex2+hex3;
@@ -31,7 +31,7 @@
};
-Signature.prototype.decode =function( decoder) {
+Signature.prototype.from_ccnb =function( decoder) {
decoder.readStartElement(this.getElementLabel());
if(LOG>4)console.log('STARTED DECODING SIGNATURE ');
@@ -39,7 +39,7 @@
if (decoder.peekStartElement(CCNProtocolDTags.DigestAlgorithm)) {
if(LOG>4)console.log('DIGIEST ALGORITHM FOUND');
- this.DigestAlgorithm = decoder.readUTF8Element(CCNProtocolDTags.DigestAlgorithm);
+ this.digestAlgorithm = decoder.readUTF8Element(CCNProtocolDTags.DigestAlgorithm);
}
if (decoder.peekStartElement(CCNProtocolDTags.Witness)) {
if(LOG>4)console.log('WITNESS FOUND FOUND');
@@ -49,7 +49,7 @@
//FORCE TO READ A SIGNATURE
//if(LOG>4)console.log('SIGNATURE FOUND ');
- this.Signature = decoder.readBinaryElement(CCNProtocolDTags.SignatureBits);
+ this.signature = decoder.readBinaryElement(CCNProtocolDTags.SignatureBits);
if(LOG>4)console.log('READ SIGNATURE ');
decoder.readEndElement();
@@ -57,7 +57,7 @@
};
-Signature.prototype.encode= function( encoder){
+Signature.prototype.to_ccnb= function( encoder){
if (!this.validate()) {
throw new Exception("Cannot encode: field values missing.");
@@ -65,7 +65,7 @@
encoder.writeStartElement(this.getElementLabel());
- if ((null != this.DigestAlgorithm) && (!this.DigestAlgorithm.equals(CCNDigestHelper.DEFAULT_DIGEST_ALGORITHM))) {
+ if ((null != this.digestAlgorithm) && (!this.digestAlgorithm.equals(CCNDigestHelper.DEFAULT_DIGEST_ALGORITHM))) {
encoder.writeElement(CCNProtocolDTags.DigestAlgorithm, OIDLookup.getDigestOID(this.DigestAlgorithm));
}
@@ -74,7 +74,7 @@
encoder.writeElement(CCNProtocolDTags.Witness, this.Witness);
}
- encoder.writeElement(CCNProtocolDTags.SignatureBits, this.Signature);
+ encoder.writeElement(CCNProtocolDTags.SignatureBits, this.signature);
encoder.writeEndElement();
};
@@ -83,6 +83,6 @@
Signature.prototype.validate = function() {
- return null != this.Signature;
+ return null != this.signature;
};
diff --git a/js/SignedInfo.js b/js/SignedInfo.js
index b2ff0b2..909545a 100644
--- a/js/SignedInfo.js
+++ b/js/SignedInfo.js
@@ -14,19 +14,19 @@
//TODO, Check types
- this.Publisher = _publisher; //PublisherPublicKeyDigest
- this.Timestamp=_timestamp; // CCN Time
- this.Type=_type; // ContentType
- this.Locator =_locator;//KeyLocator
- this.FreshnessSeconds =_freshnessSeconds; // Integer
- this.FinalBlockID=_finalBlockID; //byte array
+ this.publisher = _publisher; //publisherPublicKeyDigest
+ this.timestamp=_timestamp; // CCN Time
+ this.type=_type; // ContentType
+ this.locator =_locator;//KeyLocator
+ this.freshnessSeconds =_freshnessSeconds; // Integer
+ this.finalBlockID=_finalBlockID; //byte array
};
SignedInfo.prototype.setFields = function(){
//BASE64 -> RAW STRING
- //this.Locator = new KeyLocator( DataUtils.toNumbersFromString(stringCertificate) ,KeyLocatorType.CERTIFICATE );
+ //this.locator = new KeyLocator( DataUtils.toNumbersFromString(stringCertificate) ,KeyLocatorType.CERTIFICATE );
var publicKeyHex = globalKeyManager.publicKey;
@@ -49,48 +49,48 @@
var publisherKeyDigest = hex_sha256_from_bytes(publicKeyBytes);
- this.Publisher = new PublisherPublicKeyDigest( DataUtils.toNumbers( publisherKeyDigest ) );
+ this.publisher = new PublisherPublicKeyDigest( DataUtils.toNumbers( publisherKeyDigest ) );
- //this.Publisher = new PublisherPublicKeyDigest(publisherkey);
+ //this.publisher = new PublisherPublicKeyDigest(publisherkey);
var d = new Date();
var time = d.getTime();
- this.Timestamp = new CCNTime( time );
+ this.timestamp = new CCNTime( time );
if(LOG>4)console.log('TIME msec is');
- if(LOG>4)console.log(this.Timestamp.msec);
+ if(LOG>4)console.log(this.timestamp.msec);
//DATA
- this.Type = 0;//0x0C04C0;//ContentTypeValue[ContentType.DATA];
+ this.type = 0;//0x0C04C0;//ContentTypeValue[ContentType.DATA];
//if(LOG>4)console.log('toNumbersFromString(stringCertificate) '+DataUtils.toNumbersFromString(stringCertificate));
console.log('PUBLIC KEY TO WRITE TO CONTENT OBJECT IS ');
console.log(publicKeyBytes);
- this.Locator = new KeyLocator( publicKeyBytes ,KeyLocatorType.KEY );
+ this.locator = new KeyLocator( publicKeyBytes ,KeyLocatorType.KEY );
- //this.Locator = new KeyLocator( DataUtils.toNumbersFromString(stringCertificate) ,KeyLocatorType.CERTIFICATE );
+ //this.locator = new KeyLocator( DataUtils.toNumbersFromString(stringCertificate) ,KeyLocatorType.CERTIFICATE );
};
-SignedInfo.prototype.decode = function( decoder){
+SignedInfo.prototype.from_ccnb = function( decoder){
decoder.readStartElement( this.getElementLabel() );
if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
if(LOG>3) console.log('DECODING PUBLISHER KEY');
- this.Publisher = new PublisherPublicKeyDigest();
- this.Publisher.decode(decoder);
+ this.publisher = new PublisherPublicKeyDigest();
+ this.publisher.from_ccnb(decoder);
}
if (decoder.peekStartElement(CCNProtocolDTags.Timestamp)) {
- this.Timestamp = decoder.readDateTime(CCNProtocolDTags.Timestamp);
- if(LOG>4)console.log('TIMESTAMP FOUND IS '+this.Timestamp);
+ this.timestamp = decoder.readDateTime(CCNProtocolDTags.Timestamp);
+ if(LOG>4)console.log('TIMESTAMP FOUND IS '+this.timestamp);
}
@@ -98,72 +98,72 @@
binType = decoder.readBinaryElement(CCNProtocolDTags.Type);//byte []
- //TODO Implement Type of Key Reading
+ //TODO Implement type of Key Reading
if(LOG>4)console.log('Binary Type of of Signed Info is '+binType);
- this.Type = binType;
+ this.type = binType;
- //TODO Implement Type of Key Reading
+ //TODO Implement type of Key Reading
- if (null == this.Type) {
+ if (null == this.type) {
throw new Exception("Cannot parse signedInfo type: bytes.");
}
} else {
- this.Type = ContentType.DATA; // default
+ this.type = ContentType.DATA; // default
}
if (decoder.peekStartElement(CCNProtocolDTags.FreshnessSeconds)) {
- this.FreshnessSeconds = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds);
- if(LOG>4) console.log('FRESHNESS IN SECONDS IS '+ this.FreshnessSeconds);
+ this.freshnessSeconds = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds);
+ if(LOG>4) console.log('FRESHNESS IN SECONDS IS '+ this.freshnessSeconds);
}
if (decoder.peekStartElement(CCNProtocolDTags.FinalBlockID)) {
- this.FinalBlockID = decoder.readBinaryElement(CCNProtocolDTags.FinalBlockID);
+ this.finalBlockID = decoder.readBinaryElement(CCNProtocolDTags.FinalBlockID);
}
if (decoder.peekStartElement(CCNProtocolDTags.KeyLocator)) {
- this.Locator = new KeyLocator();
- this.Locator.decode(decoder);
+ this.locator = new KeyLocator();
+ this.locator.from_ccnb(decoder);
}
decoder.readEndElement();
};
-SignedInfo.prototype.encode = function( encoder) {
+SignedInfo.prototype.to_ccnb = function( encoder) {
if (!this.validate()) {
throw new Exception("Cannot encode : field values missing.");
}
encoder.writeStartElement(this.getElementLabel());
- if (null!=this.Publisher) {
- if(LOG>3) console.log('ENCODING PUBLISHER KEY' + this.Publisher.PublisherPublicKeyDigest);
+ if (null!=this.publisher) {
+ if(LOG>3) console.log('ENCODING PUBLISHER KEY' + this.publisher.publisherPublicKeyDigest);
- this.Publisher.encode(encoder);
+ this.publisher.to_ccnb(encoder);
}
- if (null!=this.Timestamp) {
- encoder.writeDateTime(CCNProtocolDTags.Timestamp, this.Timestamp );
+ if (null!=this.timestamp) {
+ encoder.writeDateTime(CCNProtocolDTags.Timestamp, this.timestamp );
}
- if (null!=this.Type && this.Type !=0) {
+ if (null!=this.type && this.type !=0) {
- encoder.writeElement(CCNProtocolDTags.Type, this.Type);
+ encoder.writeElement(CCNProtocolDTags.type, this.type);
}
- if (null!=this.FreshnessSeconds) {
- encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.FreshnessSeconds);
+ if (null!=this.freshnessSeconds) {
+ encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.freshnessSeconds);
}
- if (null!=this.FinalBlockID) {
- encoder.writeElement(CCNProtocolDTags.FinalBlockID, this.FinalBlockID);
+ if (null!=this.finalBlockID) {
+ encoder.writeElement(CCNProtocolDTags.FinalBlockID, this.finalBlockID);
}
- if (null!=this.Locator) {
- this.Locator.encode(encoder);
+ if (null!=this.locator) {
+ this.locator.to_ccnb(encoder);
}
encoder.writeEndElement();
@@ -185,7 +185,7 @@
SignedInfo.prototype.validate = function() {
// We don't do partial matches any more, even though encoder/decoder
// is still pretty generous.
- if (null ==this.Publisher || null==this.Timestamp ||null== this.Locator)
+ if (null ==this.publisher || null==this.timestamp ||null== this.locator)
return false;
return true;
};
diff --git a/js/encoding/EncodingUtils.js b/js/encoding/EncodingUtils.js
index 653bafd..d90a240 100644
--- a/js/encoding/EncodingUtils.js
+++ b/js/encoding/EncodingUtils.js
@@ -65,7 +65,7 @@
var faceInstance = new FaceInstance();
- faceInstance.decode(decoder);
+ faceInstance.from_ccnb(decoder);
return faceInstance;
@@ -113,7 +113,7 @@
forwardingEntry = new ForwardingEntry();
- forwardingEntry.decode(decoder);
+ forwardingEntry.from_ccnb(decoder);
return forwardingEntry;
@@ -130,11 +130,11 @@
else if (co==-2)
output+= "CONTENT NAME IS EMPTY"
else{
- if(co.name!=null && co.name.Components!=null){
+ if(co.name!=null && co.name.components!=null){
output+= "NAME: ";
- for(var i=0;i<co.name.Components.length;i++){
- output+= "/"+ DataUtils.toString(co.name.Components[i]);
+ for(var i=0;i<co.name.components.length;i++){
+ output+= "/"+ DataUtils.toString(co.name.components[i]);
}
output+= "<br />";
output+= "<br />";
@@ -152,36 +152,36 @@
output+= "<br />";
output+= "<br />";
}
- if(co.Signature !=null && co.Signature.Signature!=null){
- output += "SIGNATURE(hex): "+ DataUtils.toHex(co.Signature.Signature);
+ if(co.signature !=null && co.signature.signature!=null){
+ output += "SIGNATURE(hex): "+ DataUtils.toHex(co.signature.signature);
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Publisher!=null && co.SignedInfo.Publisher.PublisherPublicKeyDigest!=null){
- output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.SignedInfo.Publisher.PublisherPublicKeyDigest);
+ if(co.signedInfo !=null && co.signedInfo.publisher!=null && co.signedInfo.publisher.publisherPublicKeyDigest!=null){
+ output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.signedInfo.publisher.publisherPublicKeyDigest);
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Timestamp!=null){
+ if(co.signedInfo !=null && co.signedInfo.timestamp!=null){
var d = new Date();
- d.setTime( co.SignedInfo.Timestamp.msec );
+ d.setTime( co.signedInfo.timestamp.msec );
var bytes = [217, 185, 12, 225, 217, 185, 12, 225];
output += "TimeStamp: "+d;
output+= "<br />";
- output += "TimeStamp(number): "+ co.SignedInfo.Timestamp.msec;
+ output += "TimeStamp(number): "+ co.signedInfo.timestamp.msec;
output+= "<br />";
}
- if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Certificate!=null){
- var tmp = DataUtils.toString(co.SignedInfo.Locator.Certificate);
+ if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.certificate!=null){
+ var tmp = DataUtils.toString(co.signedInfo.locator.certificate);
var publickey = rstr2b64(tmp);
- var publickeyHex = DataUtils.toHex(co.SignedInfo.Locator.Certificate).toLowerCase();
- var publickeyString = DataUtils.toString(co.SignedInfo.Locator.Certificate);
- var signature = DataUtils.toHex(co.Signature.Signature).toLowerCase();
+ var publickeyHex = DataUtils.toHex(co.signedInfo.locator.certificate).toLowerCase();
+ var publickeyString = DataUtils.toString(co.signedInfo.locator.certificate);
+ var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
var input = DataUtils.toString(co.rawSignatureData);
output += "DER Certificate: "+publickey ;
@@ -201,7 +201,7 @@
if(LOG>2) console.log(" Signature is");
if(LOG>2) console.log( signature );
//if(LOG>2) console.log(" Signature NOW IS" );
- //if(LOG>2) console.log(co.Signature.Signature);
+ //if(LOG>2) console.log(co.signature.signature);
var x509 = new X509();
x509.readCertPEM(publickey);
@@ -250,18 +250,18 @@
else
output += 'SIGNATURE INVALID';
- //output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+ //output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
output+= "<br />";
output+= "<br />";
//if(LOG>4) console.log('str'[1]);
}
- if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.PublicKey!=null){
- var publickey = rstr2b64(DataUtils.toString(co.SignedInfo.Locator.PublicKey));
- var publickeyHex = DataUtils.toHex(co.SignedInfo.Locator.PublicKey).toLowerCase();
- var publickeyString = DataUtils.toString(co.SignedInfo.Locator.PublicKey);
- var signature = DataUtils.toHex(co.Signature.Signature).toLowerCase();
+ if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.publicKey!=null){
+ var publickey = rstr2b64(DataUtils.toString(co.signedInfo.locator.publicKey));
+ var publickeyHex = DataUtils.toHex(co.signedInfo.locator.publicKey).toLowerCase();
+ var publickeyString = DataUtils.toString(co.signedInfo.locator.publicKey);
+ var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
var input = DataUtils.toString(co.rawSignatureData);
output += "DER Certificate: "+publickey ;
@@ -278,7 +278,7 @@
if(LOG>2) console.log(" Signature NOW IS" );
- if(LOG>2) console.log(co.Signature.Signature);
+ if(LOG>2) console.log(co.signature.signature);
/*var x509 = new X509();
@@ -340,7 +340,7 @@
else
output += 'SIGNATURE INVALID';
- //output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+ //output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
output+= "<br />";
output+= "<br />";
diff --git a/js/lwNDN.js b/js/lwNDN.js
index 717ac07..c6658cd 100644
--- a/js/lwNDN.js
+++ b/js/lwNDN.js
@@ -70,13 +70,13 @@
var co = this.get("/%C1.M.S.localhost/%C1.M.SRV/ccnd");
- if(!co || !co.SignedInfo || !co.SignedInfo.Publisher || !co.SignedInfo.Publisher.PublisherPublicKeyDigest){
+ if(!co || !co.signedInfo || !co.signedInfo.publisher || !co.signedInfo.publisher.publisherPublicKeyDigest){
alert("Cannot contact router");
return null;
}
- var ccnxnodename = co.SignedInfo.Publisher.PublisherPublicKeyDigest;
+ var ccnxnodename = co.signedInfo.publisher.publisherPublicKeyDigest;
name = name.trim();
diff --git a/js/publish-data.html b/js/publish-data.html
index 1534aa9..e2574eb 100644
--- a/js/publish-data.html
+++ b/js/publish-data.html
@@ -110,7 +110,7 @@
else if (co==-2)
output+= "CONTENT NAME IS EMPTY"
else{
- if(co.name!=null && co.Name.Components!=null){
+ if(co.name!=null && co.Name.components!=null){
output+= "NAME: ";
for(var i=0;i<co.Name.Components.length;i++){
@@ -132,14 +132,14 @@
output+= "<br />";
output+= "<br />";
}
- if(co.Signature !=null && co.Signature.Signature!=null){
+ if(co.signature !=null && co.signature.signature!=null){
- output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
+ output += "SIGNATURE(hex): "+ toHex(co.signature.signature);
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Key!=null){
+ if(co.signedInfo!=null && co.SignedInfo.locator!=null && co.SignedInfo.Locator.Key!=null){
output += "PUBLISHER KEY: "+ toHex(co.SignedInfo.Locator.Key);
diff --git a/js/request-data.html b/js/request-data.html
index b86170b..5b7e0ab 100644
--- a/js/request-data.html
+++ b/js/request-data.html
@@ -98,11 +98,11 @@
if(co==null)
output+= "NO CONTENT FOUND"
else{
- if(co.name!=null && co.name.Components!=null){
+ if(co.name!=null && co.name.components!=null){
output+= "NAME: ";
- for(var i=0;i<co.name.Components.length;i++){
- output+= "/"+ DataUtils.toString(co.name.Components[i]);
+ for(var i=0;i<co.name.components.length;i++){
+ output+= "/"+ DataUtils.toString(co.name.components[i]);
}
output+= "<br />";
output+= "<br />";
@@ -121,39 +121,39 @@
output+= "<br />";
}
- if(co.Signature !=null && co.Signature.Signature!=null){
+ if(co.signature !=null && co.signature.signature!=null){
- output += "SIGNATURE(hex): "+ DataUtils.toHex(co.Signature.Signature);
+ output += "SIGNATURE(hex): "+ DataUtils.toHex(co.signature.signature);
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Publisher!=null && co.SignedInfo.Publisher.PublisherPublicKeyDigest!=null){
+ if(co.signedInfo !=null && co.signedInfo.publisher!=null && co.signedInfo.publisher.publisherPublicKeyDigest!=null){
- output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.SignedInfo.Publisher.PublisherPublicKeyDigest);
+ output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.signedInfo.publisher.publisherPublicKeyDigest);
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Timestamp!=null){
+ if(co.signedInfo !=null && co.signedInfo.timestamp!=null){
- output += "TimeStamp: "+ co.SignedInfo.Timestamp.getJavascriptDate();
+ output += "TimeStamp: "+ co.signedInfo.timestamp.getJavascriptDate();
output+= "<br />";
output+= "<br />";
- output += "TimeStamp (MILLISECONDS): "+ co.SignedInfo.Timestamp.msec;
+ output += "TimeStamp (MILLISECONDS): "+ co.signedInfo.timestamp.msec;
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.PublicKey!=null){
+ if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.publicKey!=null){
- var publickey = rstr2b64(DataUtils.toString(co.SignedInfo.Locator.PublicKey));
- var publickeyHex = DataUtils.toHex(co.SignedInfo.Locator.PublicKey).toLowerCase();
- var publickeyString = DataUtils.toString(co.SignedInfo.Locator.PublicKey);
+ var publickey = rstr2b64(DataUtils.toString(co.signedInfo.locator.publicKey));
+ var publickeyHex = DataUtils.toHex(co.signedInfo.locator.publicKey).toLowerCase();
+ var publickeyString = DataUtils.toString(co.signedInfo.locator.publicKey);
- var signature = DataUtils.toHex(co.Signature.Signature).toLowerCase();
+ var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
var input = DataUtils.toString(co.rawSignatureData);
@@ -173,7 +173,7 @@
if(LOG>2) console.log(" Signature NOW IS" );
- if(LOG>2) console.log(co.Signature.Signature);
+ if(LOG>2) console.log(co.signature.signature);
/*var x509 = new X509();
@@ -245,7 +245,7 @@
- //output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+ //output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
output+= "<br />";
output+= "<br />";
diff --git a/js/testing/test-decode-FaceInstance.html b/js/testing/test-decode-FaceInstance.html
index 7818e55..196afbe 100644
--- a/js/testing/test-decode-FaceInstance.html
+++ b/js/testing/test-decode-FaceInstance.html
@@ -87,37 +87,37 @@
var output ="";
- if(faceInstance.PublisherPublicKeyDigest!=null ){
+ if(faceInstance.publisherPublicKeyDigest!=null ){
output+= "PublisherPublicKeyDigest: ";
- output+= DataUtils.toHex(faceInstance.PublisherPublicKeyDigest.PublisherPublicKeyDigest);
+ output+= DataUtils.toHex(faceInstance.publisherPublicKeyDigest.publisherPublicKeyDigest);
//output+= "PUBLISHER ID TYPE: ";
- //output+= faceInstance.PublisherPublicKeyDigest.PublisherPublicKeyDigest;
+ //output+= faceInstance.publisherPublicKeyDigest.PublisherPublicKeyDigest;
output+= "<br />";
output+= "<br />";
}
- if(faceInstance.FaceID!=null){
+ if(faceInstance.faceID!=null){
output+= "FaceID: ";
- output+= faceInstance.FaceID;
+ output+= faceInstance.faceID;
output+= "<br />";
}
- if(faceInstance.IPProto!=null){
+ if(faceInstance.ipProto!=null){
output+= "IPProto: ";
- output+= faceInstance.IPProto;
+ output+= faceInstance.ipProto;
output+= "<br />";
}
- if(faceInstance.Host!=null){
+ if(faceInstance.host!=null){
output+= "Host: ";
- output+= faceInstance.Host;
+ output+= faceInstance.host;
output+= "<br />";
}
@@ -127,14 +127,14 @@
output+= faceInstance.Port;
output+= "<br />";
}
- if(faceInstance.FreshnessSeconds!=null){
+ if(faceInstance.freshnessSeconds!=null){
output+= "FreshnessSeconds: ";
- output+= faceInstance.FreshnessSeconds;
+ output+= faceInstance.freshnessSeconds;
output+= "<br />";
}
- /*if(interest.name!=null && interest.name.Components!=null){
+ /*if(interest.name!=null && interest.name.components!=null){
output+= "NAME: ";
for(var i=0;i<interest.Name.Components.length;i++){
diff --git a/js/testing/test-decode-Interest+Forwarding+Entry.html b/js/testing/test-decode-Interest+Forwarding+Entry.html
index 0ece80f..5e5e1c0 100644
--- a/js/testing/test-decode-Interest+Forwarding+Entry.html
+++ b/js/testing/test-decode-Interest+Forwarding+Entry.html
@@ -91,11 +91,11 @@
var output ="";
- if(interest.name!=null && interest.name.Components!=null){
+ if(interest.name!=null && interest.name.components!=null){
output+= "NAME: ";
- for(var i=0;i<interest.name.Components.length;i++){
- output+= "/"+ DataUtils.toString(interest.name.Components[i]);
+ for(var i=0;i<interest.name.components.length;i++){
+ output+= "/"+ DataUtils.toString(interest.name.components[i]);
}
output+= "<br />";
output+= "<br />";
@@ -168,7 +168,7 @@
if(interest.publisherPublicKeyDigest!=null ){
output+= "PUBLISHER PUBLIC KEY DIGEST: ";
- output+= interest.publisherPublicKeyDigest.PublisherPublicKeyDigest;
+ output+= interest.publisherPublicKeyDigest.publisherPublicKeyDigest;
output+= "<br />";
output+= "<br />";
@@ -192,10 +192,10 @@
output+= "<br />";
}
- if(interest.name.Components[3] !=null){
+ if(interest.name.components[3] !=null){
- var input = DataUtils.toHex(interest.name.Components[3]) ;
+ var input = DataUtils.toHex(interest.name.components[3]) ;
var contentObject = decodeHexContentObject(input);
@@ -217,11 +217,11 @@
////////////////////////////////////////
- if(co.name!=null && co.name.Components!=null){
+ if(co.name!=null && co.name.components!=null){
output+= "NAME: ";
- for(var i=0;i<co.name.Components.length;i++){
- output+= "/"+ DataUtils.toString(co.name.Components[i]);
+ for(var i=0;i<co.name.components.length;i++){
+ output+= "/"+ DataUtils.toString(co.name.components[i]);
}
output+= "<br />";
output+= "<br />";
@@ -239,65 +239,65 @@
output+= "<br />";
output+= "<br />";
}
- if(co.Signature !=null && co.Signature.Signature!=null){
+ if(co.signature !=null && co.signature.signature!=null){
- output += "SIGNATURE(hex): "+ DataUtils.toHex(co.Signature.Signature);
+ output += "SIGNATURE(hex): "+ DataUtils.toHex(co.signature.signature);
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Publisher!=null && co.SignedInfo.Publisher.PublisherPublicKeyDigest!=null){
+ if(co.signedInfo !=null && co.signedInfo.publisher!=null && co.signedInfo.publisher.publisherPublicKeyDigest!=null){
- output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.SignedInfo.Publisher.PublisherPublicKeyDigest);
+ output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.signedInfo.publisher.publisherPublicKeyDigest);
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Timestamp!=null){
+ if(co.signedInfo !=null && co.signedInfo.timestamp!=null){
var d = new Date();
- d.setTime( co.SignedInfo.Timestamp.msec );
+ d.setTime( co.signedInfo.timestamp.msec );
var bytes = [217, 185, 12, 225, 217, 185, 12, 225];
output += "TimeStamp: "+d;
output+= "<br />";
- output += "TimeStamp(number): "+ co.SignedInfo.Timestamp.msec;
+ output += "TimeStamp(number): "+ co.signedInfo.timestamp.msec;
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Type!=null){
+ if(co.signedInfo !=null && co.signedInfo.type!=null){
- output += "Type: "+co.SignedInfo.Type;
+ output += "Type: "+co.signedInfo.type;
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Locator!=null){
+ if(co.signedInfo !=null && co.signedInfo.locator!=null){
- output += "Locator: "+co.SignedInfo.Locator.Type;
+ output += "Locator: "+co.signedInfo.locator.type;
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.FreshnessSeconds!=null){
+ if(co.signedInfo !=null && co.signedInfo.freshnessSeconds!=null){
- output += "FreshnessSeconds: "+co.SignedInfo.FreshnessSeconds;
+ output += "FreshnessSeconds: "+co.signedInfo.freshnessSeconds;
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.FinalBlockID!=null){
+ if(co.signedInfo !=null && co.signedInfo.finalBlockID!=null){
- output += "FinalBlockID: "+co.SignedInfo.FinalBlockID;
+ output += "FinalBlockID: "+co.signedInfo.finalBlockID;
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.PublicKey!=null){
+ if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.publicKey!=null){
- var publickey = rstr2b64(DataUtils.toString(co.SignedInfo.Locator.PublicKey));
- var publickeyHex = DataUtils.toHex(co.SignedInfo.Locator.PublicKey).toLowerCase();
- var publickeyString = DataUtils.toString(co.SignedInfo.Locator.PublicKey);
+ var publickey = rstr2b64(DataUtils.toString(co.signedInfo.locator.publicKey));
+ var publickeyHex = DataUtils.toHex(co.signedInfo.locator.publicKey).toLowerCase();
+ var publickeyString = DataUtils.toString(co.signedInfo.locator.publicKey);
- var signature = DataUtils.toHex(co.Signature.Signature).toLowerCase();
+ var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
var input = DataUtils.toString(co.rawSignatureData);
@@ -319,7 +319,7 @@
if(LOG>2) console.log(" Signature NOW IS" );
- if(LOG>2) console.log(co.Signature.Signature);
+ if(LOG>2) console.log(co.signature.signature);
/*var x509 = new X509();
@@ -387,7 +387,7 @@
else
output += 'SIGNATURE INVALID';
- //output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+ //output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
output+= "<br />";
output+= "<br />";
@@ -408,40 +408,40 @@
//var output ="";
- if(forwardingEntry.Action!=null ){
+ if(forwardingEntry.action!=null ){
output+= "Action: ";
- output+= DataUtils.toHex(forwardingEntry.Action);
+ output+= DataUtils.toHex(forwardingEntry.action);
output+= "<br />";
output+= "<br />";
}
- if(forwardingEntry.PrefixName!=null){
+ if(forwardingEntry.prefixName!=null){
output+= "PrefixName: ";
- output+= forwardingEntry.PrefixName.getName();
+ output+= forwardingEntry.prefixName.getName();
output+= "<br />";
}
- if(forwardingEntry.CCNID!=null){
- output+= "CCNID: ";
+ if(forwardingEntry.ccndID!=null){
+ output+= "ccndID: ";
- output+= forwardingEntry.CCNID;
+ output+= forwardingEntry.ccndID;
output+= "<br />";
}
- if(forwardingEntry.Flags!=null){
+ if(forwardingEntry.flags!=null){
output+= "Flags: ";
- output+= forwardingEntry.Flags;
+ output+= forwardingEntry.flags;
output+= "<br />";
}
- if(forwardingEntry.Lifetime!=null){
+ if(forwardingEntry.lifetime!=null){
output+= "Lifetime: ";
- output+= forwardingEntry.Lifetime;
+ output+= forwardingEntry.lifetime;
output+= "<br />";
}
diff --git a/js/testing/test-encode-decode-ContentObject-bis.html b/js/testing/test-encode-decode-ContentObject-bis.html
index f66cae5..6e8dad9 100644
--- a/js/testing/test-encode-decode-ContentObject-bis.html
+++ b/js/testing/test-encode-decode-ContentObject-bis.html
@@ -116,11 +116,11 @@
else if (co==-2)
output+= "CONTENT NAME IS EMPTY"
else{
- if(co.name!=null && co.name.Components!=null){
+ if(co.name!=null && co.name.components!=null){
output+= "NAME: ";
- for(var i=0;i<co.name.Components.length;i++){
- output+= "/"+ toString(co.name.Components[i]);
+ for(var i=0;i<co.name.components.length;i++){
+ output+= "/"+ toString(co.name.components[i]);
}
output+= "<br />";
output+= "<br />";
@@ -138,34 +138,34 @@
output+= "<br />";
output+= "<br />";
}
- if(co.Signature !=null && co.Signature.Signature!=null){
+ if(co.signature !=null && co.signature.signature!=null){
- output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
+ output += "SIGNATURE(hex): "+ toHex(co.signature.signature);
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Publisher!=null && co.SignedInfo.Publisher.PublisherPublicKeyDigest!=null){
+ if(co.signedInfo !=null && co.signedInfo.publisher!=null && co.signedInfo.publisher.publisherPublicKeyDigest!=null){
- output += "Publisher Public Key Digest(hex): "+ toHex(co.SignedInfo.Publisher.PublisherPublicKeyDigest);
+ output += "Publisher Public Key Digest(hex): "+ toHex(co.signedInfo.publisher.publisherPublicKeyDigest);
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo !=null && co.SignedInfo.Timestamp!=null){
+ if(co.signedInfo !=null && co.signedInfo.timestamp!=null){
- output += "TimeStamp(hex): "+ co.SignedInfo.Timestamp.date;
+ output += "TimeStamp(hex): "+ co.signedInfo.timestamp.date;
output+= "<br />";
output+= "<br />";
}
- if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.PublicKey!=null){
+ if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.publicKey!=null){
- var publickey = rstr2b64(toString(co.SignedInfo.Locator.PublicKey));
- var publickeyHex = toHex(co.SignedInfo.Locator.PublicKey).toLowerCase();
- var publickeyString = toString(co.SignedInfo.Locator.PublicKey);
+ var publickey = rstr2b64(toString(co.signedInfo.locator.publicKey));
+ var publickeyHex = toHex(co.signedInfo.locator.publicKey).toLowerCase();
+ var publickeyString = toString(co.signedInfo.locator.publicKey);
- var signature = toHex(co.Signature.Signature).toLowerCase();
+ var signature = toHex(co.signature.signature).toLowerCase();
var input = toString(co.rawSignatureData);
@@ -185,7 +185,7 @@
if(LOG>2) console.log(" Signature "+signature );
if(LOG>2) console.log(" Signature NOW IS" );
- if(LOG>2) console.log(co.Signature.Signature);
+ if(LOG>2) console.log(co.signature.signature);
var x509 = new X509();
@@ -231,7 +231,7 @@
- //output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+ //output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
output+= "<br />";
output+= "<br />";
diff --git a/js/testing/test-encode-decode-Interest.html b/js/testing/test-encode-decode-Interest.html
index dd3e3b4..d957176 100644
--- a/js/testing/test-encode-decode-Interest.html
+++ b/js/testing/test-encode-decode-Interest.html
@@ -100,13 +100,13 @@
var output ="";
- if(interest.name!=null && interest.name.Components!=null){
+ if(interest.name!=null && interest.name.components!=null){
output+= "NAME: ";
output+= interest.name.getName();
- /*for(var i=0;i<interest.name.Components.length;i++){
+ /*for(var i=0;i<interest.name.components.length;i++){
output+= "/"+ DataUtils.toString(interest.name.Components[i]);
}*/
@@ -127,10 +127,10 @@
if(interest.publisherID!=null ){
output+= "PUBLISHER ID: ";
- output+= interest.publisherID.PublisherID;
+ output+= interest.publisherID.publisherID;
output+= "PUBLISHER ID TYPE: ";
- output+= interest.publisherID.PublisherType;
+ output+= interest.publisherID.publisherType;
output+= "<br />";
output+= "<br />";
}