List of usage examples for org.bouncycastle.asn1 DERSequence DERSequence
public DERSequence(ASN1Encodable[] elements)
From source file:net.sourceforge.javacardsign.iso7816_15.CommonAuthenticationObjectAttributes.java
License:Open Source License
public DERObject getDERObject() { return new DERSequence(new ASN1Encodable[] { new DEROctetString(this.authId) }); }
From source file:net.sourceforge.javacardsign.iso7816_15.CommonKeyAttributes.java
License:Open Source License
public DERObject getDERObject() { DERBitString usage = new DERBitString(CommonObjectAttributes.encodeBits(this.usage), CommonObjectAttributes.getPad(this.usage)); DEROctetString id = new DEROctetString(this.id); return new DERSequence(new ASN1Encodable[] { id, usage }); }
From source file:net.sourceforge.javacardsign.iso7816_15.CommonObjectAttributes.java
License:Open Source License
public DERObject getDERObject() { DERUTF8String label = new DERUTF8String(this.label); DERBitString flags = new DERBitString(encodeBits(this.flags), getPad(this.flags)); if (authId != -1) { DEROctetString authId = new DEROctetString(new byte[] { this.authId }); return new DERSequence(new ASN1Encodable[] { label, flags, authId }); } else {/*from w ww. java 2 s . c om*/ return new DERSequence(new ASN1Encodable[] { label, flags }); } }
From source file:net.sourceforge.javacardsign.iso7816_15.ElementaryFileCIAInfo.java
License:Open Source License
public DERObject getDERObject() { DERInteger version = new DERInteger(this.version); DERUTF8String manufacturerId = new DERUTF8String(this.manufacturerId); DERBitString cardFlags = new DERBitString(CommonObjectAttributes.encodeBits(this.cardFlags), CommonObjectAttributes.getPad(this.cardFlags)); ASN1Encodable[] algs = new ASN1Encodable[algorithmInfos.length]; for (int i = 0; i < algs.length; i++) { algs[i] = this.algorithmInfos[i].getDERObject(); }/*from www . ja va2 s.c om*/ DERSequence algorithmInfos = new DERSequence(algs); return new DERSequence(new ASN1Encodable[] { version, manufacturerId, cardFlags, new DERSequence(), new DERSequence(algorithmInfos) }); }
From source file:net.sourceforge.javacardsign.iso7816_15.ObjectDirectoryEntry.java
License:Open Source License
public DERObject getDERObject() { byte[] p = new byte[2]; p[0] = (byte) (this.fid >> 8 & 0xFF); p[1] = (byte) (this.fid & 0xFF); DERSequence path = new DERSequence(new ASN1Encodable[] { new DEROctetString(p) }); return new DERTaggedObject(tag, path); }
From source file:net.sourceforge.javacardsign.iso7816_15.PasswordAttributes.java
License:Open Source License
public DERObject getDERObject() { DERBitString flags = new DERBitString(CommonObjectAttributes.encodeBits(this.flags), CommonObjectAttributes.getPad(this.flags)); DEREnumerated type = new DEREnumerated(this.type); DERInteger minLength = new DERInteger(this.minLength); DERInteger storedLength = new DERInteger(this.storedLength); return new DERSequence(new ASN1Encodable[] { flags, type, minLength, storedLength }); }
From source file:net.sourceforge.javacardsign.iso7816_15.PrivateKeyAttributes.java
License:Open Source License
public DERObject getDERObject() { DERInteger idType = new DERInteger(4); DEROctetString id = new DEROctetString(this.keyId); return new DERSequence(new ASN1Encodable[] { idType, id }); }
From source file:net.sourceforge.javacardsign.iso7816_15.RSAPrivateKeyAttributes.java
License:Open Source License
public DERObject getDERObject() { byte[] p = new byte[2]; p[0] = (byte) (this.path >> 8 & 0xFF); p[1] = (byte) (this.path & 0xFF); DERSequence path = new DERSequence(new ASN1Encodable[] { new DEROctetString(p) }); DERInteger modSize = new DERInteger(this.modSize); return new DERSequence(new ASN1Encodable[] { path, modSize }); }
From source file:net.sourceforge.javacardsign.iso7816_15.RSAPrivateKeyDirectoryEntry.java
License:Open Source License
public DERObject getDERObject() { return new DERSequence(new ASN1Encodable[] { coa.getDERObject(), cka.getDERObject(), new DERTaggedObject(0, pka.getDERObject()), new DERTaggedObject(1, rpka.getDERObject()) }); }
From source file:net.sourceforge.javacardsign.iso7816_15.X509CertificateAttributes.java
License:Open Source License
public DERObject getDERObject() { byte[] p = new byte[2]; p[0] = (byte) (this.path >> 8 & 0xFF); p[1] = (byte) (this.path & 0xFF); DERSequence path = new DERSequence(new ASN1Encodable[] { new DEROctetString(p) }); return new DERSequence(new ASN1Encodable[] { path }); }