Skip to content

Commit 8a4f9b0

Browse files
committed
chore: pr review feedback
1 parent 9aff08f commit 8a4f9b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/microsoft/graph/core/models/DecryptableContent.java

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public interface DecryptableContent {
107107
* @throws Exception if an error occurs while decrypting the data
108108
*/
109109
public static @Nonnull String decryptAsString(@Nonnull final DecryptableContent content, @Nonnull final CertificateKeyProvider certificateKeyProvider) throws Exception {
110+
Objects.requireNonNull(content);
110111
Objects.requireNonNull(certificateKeyProvider);
111112
final Key privateKey = certificateKeyProvider.getCertificateKey(content.getEncryptionCertificateId(), content.getEncryptionCertificateThumbprint());
112113
final Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWITHSHA1ANDMGF1PADDING");
@@ -132,6 +133,8 @@ public interface DecryptableContent {
132133
* @throws Exception if an error occurs while decrypting the data
133134
*/
134135
public static @Nonnull byte[] aesDecrypt(@Nonnull final byte[] data, @Nonnull final byte[] key) throws Exception {
136+
Objects.requireNonNull(data);
137+
Objects.requireNonNull(key);
135138
try {
136139
@SuppressWarnings("java:S3329")
137140
// Sonar warns that a random IV should be used for encryption

0 commit comments

Comments
 (0)