@Override protected int encodingBodyLength() { byte[] body = getValue(); if (body != null) { return body.length + 1; } return 0; }
public void setSubjectPubKey(byte[] subjectPubKey) { setFieldAs(SubjectPublicKeyInfoField.SUBJECT_PUBLIC_KEY, new Asn1BitString(subjectPubKey)); } }
@Override protected void toBytes() { byte[] bytes = new byte[encodingBodyLength()]; byte[] body = getValue(); if (body != null) { bytes[0] = (byte) padding; System.arraycopy(body, 0, bytes, 1, bytes.length - 1); } setBytes(bytes); }
@Override public String toString() { String typeStr = tag().typeStr() + " [" + "tag=" + tag() + ", len=" + getHeaderLength() + "+" + getBodyLength() + "] "; byte[] valueBytes = getValue(); String valueStr = "<null>"; if (valueBytes != null) { valueStr = "<" + valueBytes.length + " bytes>"; } return typeStr + valueStr; } }
@Override protected void toValue() throws IOException { byte[] bytes = getBytes(); if (bytes.length < 1) { throw new IOException("Bad stream, zero bytes found for bitstring"); } int paddingBits = bytes[0]; validatePaddingBits(paddingBits); setPadding(paddingBits); byte[] newBytes = new byte[bytes.length - 1]; if (bytes.length > 1) { System.arraycopy(bytes, 1, newBytes, 0, bytes.length - 1); } setValue(newBytes); }
@Override public String toString() { String typeStr = tag().typeStr() + " [" + "tag=" + tag() + ", len=" + getHeaderLength() + "+" + getBodyLength() + "] "; byte[] valueBytes = getValue(); String valueStr = "<null>"; if (valueBytes != null) { valueStr = "<" + valueBytes.length + " bytes>"; } return typeStr + valueStr; } }
@Override protected void toValue() throws IOException { byte[] bytes = getBytes(); if (bytes.length < 1) { throw new IOException("Bad stream, zero bytes found for bitstring"); } int paddingBits = bytes[0]; validatePaddingBits(paddingBits); setPadding(paddingBits); byte[] newBytes = new byte[bytes.length - 1]; if (bytes.length > 1) { System.arraycopy(bytes, 1, newBytes, 0, bytes.length - 1); } setValue(newBytes); }
@Override protected int encodingBodyLength() { byte[] body = getValue(); if (body != null) { return body.length + 1; } return 0; }
public void setSubjectPubKey(byte[] subjectPubKey) { setFieldAs(SubjectPublicKeyInfoField.SUBJECT_PUBLIC_KEY, new Asn1BitString(subjectPubKey)); } }
@Override protected void toBytes() { byte[] bytes = new byte[encodingBodyLength()]; byte[] body = getValue(); if (body != null) { bytes[0] = (byte) padding; System.arraycopy(body, 0, bytes, 1, bytes.length - 1); } setBytes(bytes); }
public byte[] getIssuerUniqueID() { return getFieldAs(TBSCertificateField.ISSUER_UNIQUE_ID, Asn1BitString.class).getValue(); }
public void setSubjectUniqueId(byte[] issuerUniqueId) { setFieldAs(TBSCertificateField.SUBJECT_UNIQUE_ID, new Asn1BitString(issuerUniqueId)); }
public byte[] getIssuerUniqueID() { return getFieldAs(ACInfoField.ISSUER_UNIQUE_ID, Asn1BitString.class).getValue(); }
public void setIssuerUniqueId(byte[] issuerUniqueId) { setFieldAs(ACInfoField.ISSUER_UNIQUE_ID, new Asn1BitString(issuerUniqueId)); }
public byte[] getIssuerUniqueID() { return getFieldAs(AttributeCertificateInfoV1Field.ISSUER_UNIQUE_ID, Asn1BitString.class).getValue(); }
public void setIssuerUniqueId(byte[] issuerUniqueId) { setFieldAs(AttributeCertificateInfoV1Field.ISSUER_UNIQUE_ID, new Asn1BitString(issuerUniqueId)); }
public byte[] getIssuerUniqueID() { return getFieldAs(TBSCertificateField.ISSUER_UNIQUE_ID, Asn1BitString.class).getValue(); }
public void setIssuerUniqueId(byte[] issuerUniqueId) { setFieldAs(AttributeCertificateInfoV1Field.ISSUER_UNIQUE_ID, new Asn1BitString(issuerUniqueId)); }
public byte[] getSubjectUniqueId() { return getFieldAs(TBSCertificateField.ISSUER_UNIQUE_ID, Asn1BitString.class).getValue(); }
public void setIssuerUniqueId(byte[] issuerUniqueId) { setFieldAs(TBSCertificateField.ISSUER_UNIQUE_ID, new Asn1BitString(issuerUniqueId)); }