public abstract class AbstractBlock extends Object implements Block
Constructor and Description |
---|
AbstractBlock() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
fromBase64(String b)
Decode a base64 encoded string representation to a byte array.
|
static byte[] |
fromHex(String s)
Converts the values of a given String to a byte array.
|
protected abstract void |
parse(org.bouncycastle.asn1.ASN1Encodable to) |
protected void |
parse(byte[] b) |
protected String |
prepareDump(String s) |
static String |
toBase64(byte[] b)
Get a base64 encoded string representation of the byte array.
|
static String |
toBitString(org.bouncycastle.asn1.ASN1BitString bs)
Convert an ASN.1 Bit String to the respective string representation.
|
byte[] |
toBytes(DumpType dumpType)
Dumps the object as ASN.1 der encoded byte array.
|
protected static byte[] |
toDer(org.bouncycastle.asn1.ASN1Object a) |
static String |
toHex(byte[] data)
Converts a byte array to a hex representation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dumpValueNotation
toAsn1Object
protected static final String CRLF
public static byte[] fromHex(String s)
Converts the values of a given String to a byte array.
s
- the string to be converted containing hex digitspublic static byte[] fromBase64(String b)
Decode a base64 encoded string representation to a byte array.
b
- the string to be decodedpublic static String toBase64(byte[] b)
Get a base64 encoded string representation of the byte array.
b
- the byte array to be encodedpublic static String toHex(byte[] data)
Converts a byte array to a hex representation.
data
- the byte array to be converted to hexpublic static String toBitString(org.bouncycastle.asn1.ASN1BitString bs)
Convert an ASN.1 Bit String to the respective string representation.
bs
- The BitString to be representedprotected void parse(byte[] b) throws IOException
IOException
protected abstract void parse(org.bouncycastle.asn1.ASN1Encodable to) throws IOException
IOException
protected static byte[] toDer(org.bouncycastle.asn1.ASN1Object a)
public byte[] toBytes(DumpType dumpType) throws IOException
Dumps the object as ASN.1 der encoded byte array.
toBytes
in interface Block
dumpType
- the dump type to be used (@see DumpType)IOException
- if encoding was unsuccessfulCopyright © 2023. All rights reserved.