Package com.microsoft.graph.core.models
Interface DecryptableContent
public interface DecryptableContent
DecryptableContent interface
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvides a private key for the certificate with the ID provided when creating the subscription and the thumbprint. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]aesDecrypt(byte[] data, byte[] key) Decrypts the resource data using the decrypted symmetric keystatic <T extends com.microsoft.kiota.serialization.Parsable>
Tdecrypt(DecryptableContent decryptableContent, DecryptableContent.CertificateKeyProvider certificateKeyProvider, com.microsoft.kiota.serialization.ParsableFactory<T> factory) Validates the signature of the resource data, decrypts resource data and deserializes the data to a Parsable https://learn.microsoft.com/en-us/graph/change-notifications-with-resource-data?tabs=csharp#decrypting-resource-data-from-change-notificationsstatic StringdecryptAsString(DecryptableContent content, DecryptableContent.CertificateKeyProvider certificateKeyProvider) Validates the signature and decrypts resource data attached to the notification.getData()Gets the dataGets the data keyGets the data signatureGets the encryption certificate idGets the encryption certificate thumbprintvoidSets the datavoidsetDataKey(String dataKey) Sets the data keyvoidsetDataSignature(String signature) Sets the data signaturevoidsetEncryptionCertificateId(String encryptionCertificateId) Sets the encryption certificate idvoidsetEncryptionCertificateThumbprint(String encryptionCertificateThumbprint) Sets the encryption certificate thumbprint
-
Method Details
-
setData
Sets the data- Parameters:
data- resource data
-
getData
Gets the data- Returns:
- the data
-
setDataKey
Sets the data key- Parameters:
dataKey- asymmetric key used to sign data
-
getDataKey
Gets the data key- Returns:
- the data key
-
setDataSignature
Sets the data signature- Parameters:
signature- signature of the data
-
getDataSignature
Gets the data signature- Returns:
- data signature
-
setEncryptionCertificateId
Sets the encryption certificate id- Parameters:
encryptionCertificateId- certificate Id used when subscribing
-
getEncryptionCertificateId
Gets the encryption certificate id- Returns:
- the encryption certificate id
-
setEncryptionCertificateThumbprint
Sets the encryption certificate thumbprint- Parameters:
encryptionCertificateThumbprint- certificate thumbprint
-
getEncryptionCertificateThumbprint
Gets the encryption certificate thumbprint- Returns:
- the encryption certificate thumbprint
-
decrypt
@Nonnull static <T extends com.microsoft.kiota.serialization.Parsable> T decrypt(@Nonnull DecryptableContent decryptableContent, @Nonnull DecryptableContent.CertificateKeyProvider certificateKeyProvider, @Nonnull com.microsoft.kiota.serialization.ParsableFactory<T> factory) throws Exception Validates the signature of the resource data, decrypts resource data and deserializes the data to a Parsable https://learn.microsoft.com/en-us/graph/change-notifications-with-resource-data?tabs=csharp#decrypting-resource-data-from-change-notifications- Type Parameters:
T- Parsable type to return- Parameters:
decryptableContent- instance of DecryptableContentcertificateKeyProvider- provides an RSA Private Key for the certificate provided when subscribingfactory- ParsableFactory for the return type- Returns:
- decrypted resource data
- Throws:
Exception- if an error occurs while decrypting the data
-
decryptAsString
@Nonnull static String decryptAsString(@Nonnull DecryptableContent content, @Nonnull DecryptableContent.CertificateKeyProvider certificateKeyProvider) throws Exception Validates the signature and decrypts resource data attached to the notification. https://learn.microsoft.com/en-us/graph/change-notifications-with-resource-data?tabs=csharp#decrypting-resource-data-from-change-notifications- Parameters:
content- instance of DecryptableContentcertificateKeyProvider- provides an RSA Private Key for the certificate provided when subscribing- Returns:
- decrypted resource data
- Throws:
Exception- if an error occurs while decrypting the data
-
aesDecrypt
Decrypts the resource data using the decrypted symmetric key- Parameters:
data- Base-64 decoded resource datakey- Decrypted symmetric key from DecryptableContent.getDataKey()- Returns:
- decrypted resource data
- Throws:
Exception- if an error occurs while decrypting the data
-