Package net.messagevortex.asn1
Class AbstractBlock
java.lang.Object
net.messagevortex.asn1.AbstractBlock
- Direct Known Subclasses:
AlgorithmParameter,AsymmetricAlgorithmSpec,BlendingParameter,BlendingSpec,CipherSpec,HeaderRequest,HeaderRequestFactory,IdentityBlock,IdentityStore,IdentityStoreBlock,InnerMessageBlock,Key,MacAlgorithm,Operation,PayloadChunk,PrefixBlock,ReplyBlock,RoutingCombo,SizeBlock,UsagePeriod,VortexMessage
Abstract class collecting all ASN1 Block parser classes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]fromBase64(String b) Decode a base64 encoded string representation to a byte array.static byte[]Converts the values of a given String to a byte array.protected voidparse(byte[] b) protected abstract voidparse(org.bouncycastle.asn1.ASN1Encodable to) protected Stringstatic StringtoBase64(byte[] b) Get a base64 encoded string representation of the byte array.static StringtoBitString(org.bouncycastle.asn1.ASN1BitString bs) Convert an ASN.1 Bit String to the respective string representation.byte[]Dumps the object as ASN.1 der encoded byte array.protected static byte[]toDer(org.bouncycastle.asn1.ASN1Object a) static StringtoHex(byte[] data) Converts a byte array to a hex representation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.messagevortex.asn1.Block
dumpValueNotationMethods inherited from interface net.messagevortex.asn1.Dumpable
toAsn1Object
-
Field Details
-
CRLF
- See Also:
-
-
Constructor Details
-
AbstractBlock
public AbstractBlock()
-
-
Method Details
-
fromHex
Converts the values of a given String to a byte array.
- Parameters:
s- the string to be converted containing hex digits- Returns:
- the resulting byte array
-
fromBase64
Decode a base64 encoded string representation to a byte array.
- Parameters:
b- the string to be decoded- Returns:
- the decoded equivalent
-
toBase64
Get a base64 encoded string representation of the byte array.
- Parameters:
b- the byte array to be encoded- Returns:
- the encoded equivalent
-
toHex
Converts a byte array to a hex representation.
- Parameters:
data- the byte array to be converted to hex- Returns:
- the resuting hex string
-
toBitString
Convert an ASN.1 Bit String to the respective string representation.
- Parameters:
bs- The BitString to be represented- Returns:
- the resulting string.
-
parse
- Throws:
IOException
-
parse
- Throws:
IOException
-
toDer
protected static byte[] toDer(org.bouncycastle.asn1.ASN1Object a) -
toBytes
Dumps the object as ASN.1 der encoded byte array.
- Specified by:
toBytesin interfaceBlock- Parameters:
dumpType- the dump type to be used (@see DumpType)- Returns:
- the der encoded byte array
- Throws:
IOException- if encoding was unsuccessful
-
prepareDump
-