Global ASN.1 Types¶
Read this page when you know the destination type but are unsure which JSON shapes are accepted. It summarizes the project-wide rules for ASN.1-backed Java types such as OIDs, integers, octet strings, bit strings, trait containers, and algorithm identifiers.
Global ASN.1 Types¶
Documented JSON-side acceptance rules for ASN.1-backed Java types.
ASN1UTF8String¶
org.bouncycastle.asn1.ASN1UTF8String
Accepts a simple string or a JSON object with a "string" property.
ASN1BitString¶
org.bouncycastle.asn1.ASN1BitString
Supports multiple formats: 1) A Base64/Hex encoded string. 2) A JSON array of bytes. 3) A JSON object with a "base64" or "hex" property.
ASN1Boolean¶
org.bouncycastle.asn1.ASN1Boolean
Accepts JSON boolean values (true/false) or their string equivalents ("true"/"false").
ASN1Integer¶
org.bouncycastle.asn1.ASN1Integer
Accepts standard JSON numbers (int, long, big integer), decimal strings, or specialized binary formats (Hex/Base64).
ASN1ObjectIdentifier¶
org.bouncycastle.asn1.ASN1ObjectIdentifier
Supports multiple formats: 1) A simple OID string (e.g., "1.2.3"). 2) A JSON object with an "oid" property.
TraitCollection¶
tcg.credential.TraitCollection
Accepts a JSON array of Trait objects. This is a specialised TraitMap used for collections of traits.
ASN1GeneralizedTime¶
org.bouncycastle.asn1.ASN1GeneralizedTime
Accepts a date string format.
KeyUsage¶
org.bouncycastle.asn1.x509.KeyUsage
Supports multiple formats: 1) An integer bitmask. 2) A hex string. 3) A name string (e.g., "digitalSignature"). 4) An array of these formats.
Trait¶
tcg.credential.Trait
Polymorphic Trait Object
A Trait is identified and resolved using the following priority:
1. By ID: Matches traitId OID against known types.
2. By Alias: Matches any of the supported value property names (see below).
3. By Category: Matches traitCategory OID if no ID or Alias match is found.
Standard Properties:
- traitId: (Optional) OID string identifying the trait type.
- traitCategory: (Optional) OID string identifying the category.
- traitRegistry: (Optional) OID string for the registry.
- description: (Optional) UTF-8 string description.
- descriptionURI: (Optional) IA5 string URI for the description.
- traitValue: (Fallback) The value of the trait if no alias is used.
Supported Value Aliases (Property Names):
Instead of traitValue, you may use one of these property names based on the trait type: utf8String, platformFirmwareCapabilities, publicKey, ia5StringTrait, fipsLevelTrait, componentIdentifierV11, penTrait, asn1, pen, pem, componentClassTrait, ia5, certificateIdentifierTrait, asn1ObjectTrait, componentIdentifierV11Trait, platformFirmwareUpdateCompliance, platformFirmwareUpdateComplianceTrait, entGeoLocation, booleanTrait, booleanValue, platformFirmwareSignatureVerification, iso9000, networkMAC, status, rTMTypes, networkMACTrait, bool, ia5String, utf8, commonCriteriaTrait, platformHardwareCapabilities, oid, uriReference, utf8StringTrait, countryOfOriginTrait, platformFirmwareSignatureVerificationTrait, iso9000Trait, certificateIdentifier, platformFirmwareCapabilitiesTrait, publicKeyTrait, componentClass, commonCriteria, rTMTrait, rTM, componentClassValue, fipsLevel, uri, oidTrait, entGeoLocationTrait, attributeStatus, boolean, uriTrait, platformHardwareCapabilitiesTrait, pemTrait, statusTrait, countryOfOrigin.
TraitMap¶
tcg.credential.TraitMap
Accepts a JSON array of Trait objects. Runtime deserializers may also accept legacy forms and normalize them into a Trait sequence.
AlgorithmIdentifier¶
org.bouncycastle.asn1.x509.AlgorithmIdentifier
Supports multiple formats: 1) A simple OID string (representing the algorithm). 2) A JSON object with "algorithm" (OID string) and optional "parameters" (Hex/Base64 string).
ASN1OctetString¶
org.bouncycastle.asn1.ASN1OctetString
Supports multiple formats: 1) A Base64/Hex encoded string. 2) A JSON array of bytes. 3) A JSON object with a "base64" or "hex" property.
ASN1IA5String¶
org.bouncycastle.asn1.ASN1IA5String
Accepts a simple string or a JSON object with a "string" property.