public class JsonCrypto extends Object
$crypto object.
 For example:
 
 "$crypto":{
     "value":{
         "data":"wfoQJXXXXTa551pKTMjZ/Q==",
         "cipher":"AES/CBC/PKCS5Padding",
         "iv":"OXHdtVBURv6fAuRa88CDnA==",
         "key":"openidm-sym-default"
     },
     "type":"x-simple-encryption"
 }
 for constants used to build the json.| Constructor and Description | 
|---|
JsonCrypto()
Constructs an empty JSON cryptographic object. 
 | 
JsonCrypto(JsonValue value)
Constructs a new JSON cryptographic object, initializing from a JSON value. 
 | 
JsonCrypto(String type,
          JsonValue value)
Constructs a new JSON cryptographic object, initializing with the specified type
 and cryptographic value. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
fromJsonValue(JsonValue value)
Initializes this object from the specified  
$crypto JSON object value. | 
String | 
getType()
Returns the type of JSON cryptographic representation. 
 | 
JsonValue | 
getValue()
Returns the JSON cryptographic value. 
 | 
static boolean | 
isJsonCrypto(JsonValue value)
Returns  
true if the specified JSON value contains a valid $crypto
 JSON object structure. | 
void | 
setType(String type)
Sets the type of JSON cryptographic representation. 
 | 
void | 
setValue(JsonValue value)
Sets the JSON cryptographic value. 
 | 
JsonValue | 
toJsonValue()
Returns this object as a  
$crypto JSON object value. | 
public JsonCrypto()
public JsonCrypto(JsonValue value) throws JsonValueException
value - a JSON value containing a $crypto JSON object value.JsonValueException - if the specified value is malformed.public static boolean isJsonCrypto(JsonValue value)
true if the specified JSON value contains a valid $crypto
 JSON object structure.
 
 Note: This method does not suppress transformers in the specified value. Consequently,
 this method can return false if members are transformed, for example if a
 JsonCryptoTransformer transforms the value as it is being inspected.
value - The JSON to check.public String getType()
public void setType(String type)
type - the type of JSON cryptographic representation.public JsonValue getValue()
public void setValue(JsonValue value)
value - the JSON cryptographic value.public void fromJsonValue(JsonValue value) throws JsonValueException
$crypto JSON object value.value - a JSON value containing a $crypto JSON object value.JsonValueException - if the specified value is malformed.public JsonValue toJsonValue()
$crypto JSON object value.Copyright © 2025 Open Identity Platform Community. All rights reserved.