[java-opensaml] 02/02: Misc cleanup: imports, annotations.

Brent Putman putmanb at georgetown.edu
Thu Mar 11 05:28:41 UTC 2021


This is an automated email from the git hooks/post-receive script.

putmanb pushed a commit to branch main
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=7d5e0b70e430a3ea67314b7889f2350b57ff8d8e

commit 7d5e0b70e430a3ea67314b7889f2350b57ff8d8e
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Wed Mar 10 20:00:12 2021 -0500

    Misc cleanup: imports, annotations.
---
 .../src/main/java/org/opensaml/security/crypto/dh/DHSupport.java   | 7 +++----
 .../src/main/java/org/opensaml/security/crypto/ec/ECSupport.java   | 6 +++---
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/opensaml-security-api/src/main/java/org/opensaml/security/crypto/dh/DHSupport.java b/opensaml-security-api/src/main/java/org/opensaml/security/crypto/dh/DHSupport.java
index 52b9fd216..8511aeb1a 100644
--- a/opensaml-security-api/src/main/java/org/opensaml/security/crypto/dh/DHSupport.java
+++ b/opensaml-security-api/src/main/java/org/opensaml/security/crypto/dh/DHSupport.java
@@ -17,7 +17,6 @@
 
 package org.opensaml.security.crypto.dh;
 
-import java.io.IOException;
 import java.math.BigInteger;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidKeyException;
@@ -66,7 +65,7 @@ public final class DHSupport {
      * @throws NoSuchProviderException if provider is unknown
      * @throws InvalidKeyException if supplied key is invalid
      */
-    public static byte[] performKeyAgreement(@Nonnull final DHPublicKey publicKey,
+    @Nonnull public static byte[] performKeyAgreement(@Nonnull final DHPublicKey publicKey,
             @Nonnull final DHPrivateKey privateKey, @Nullable final String provider)
                     throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException {
         Constraint.isNotNull(publicKey, "DHPublicKey was null");
@@ -96,7 +95,7 @@ public final class DHSupport {
      * @throws NoSuchProviderException if provider is unknown
      * @throws InvalidAlgorithmParameterException if the public key's {@link DHParameterSpec} is not supported
      */
-    public static KeyPair generateCompatibleKeyPair(@Nonnull final DHPublicKey publicKey,
+    @Nonnull public static KeyPair generateCompatibleKeyPair(@Nonnull final DHPublicKey publicKey,
             @Nullable final String provider)
                     throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException {
         Constraint.isNotNull(publicKey, "DHPublicKey was null");
@@ -117,7 +116,7 @@ public final class DHSupport {
      * 
      * @return the prime Q domain parameter, or null if could not be processed
      */
-    public static BigInteger getPrimeQDomainParameter(@Nonnull final DHPublicKey publicKey) {
+    @Nullable public static BigInteger getPrimeQDomainParameter(@Nonnull final DHPublicKey publicKey) {
         Constraint.isNotNull(publicKey, "DHPublicKey was null");
         try (ASN1InputStream input = new ASN1InputStream(publicKey.getEncoded())) {
             final SubjectPublicKeyInfo spki = SubjectPublicKeyInfo.getInstance(input.readObject());
diff --git a/opensaml-security-api/src/main/java/org/opensaml/security/crypto/ec/ECSupport.java b/opensaml-security-api/src/main/java/org/opensaml/security/crypto/ec/ECSupport.java
index e2a4e1835..d28d6835f 100644
--- a/opensaml-security-api/src/main/java/org/opensaml/security/crypto/ec/ECSupport.java
+++ b/opensaml-security-api/src/main/java/org/opensaml/security/crypto/ec/ECSupport.java
@@ -76,7 +76,7 @@ public final class ECSupport {
      * @throws NoSuchProviderException if provider is unknown
      * @throws InvalidKeyException if supplied key is invalid
      */
-    public static byte[] performKeyAgreement(@Nonnull final ECPublicKey publicKey,
+    @Nonnull public static byte[] performKeyAgreement(@Nonnull final ECPublicKey publicKey,
             @Nonnull final ECPrivateKey privateKey, @Nullable final String provider)
                     throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException {
         Constraint.isNotNull(publicKey, "ECPublicKey was null");
@@ -106,7 +106,7 @@ public final class ECSupport {
      * @throws NoSuchProviderException if provider is unknown
      * @throws InvalidAlgorithmParameterException if the public key's {@link ECParameterSpec} is not supported
      */
-    public static KeyPair generateCompatibleKeyPair(@Nonnull final ECPublicKey publicKey,
+    @Nonnull public static KeyPair generateCompatibleKeyPair(@Nonnull final ECPublicKey publicKey,
             @Nullable final String provider)
                     throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException {
         Constraint.isNotNull(publicKey, "ECPublicKey was null");
@@ -272,7 +272,7 @@ public final class ECSupport {
      * @param b the byte array
      * @return the byte array without leading zero bytes
      */
-    private static byte[] trimZeroes(@Nonnull final byte[] b) {
+    @Nonnull private static byte[] trimZeroes(@Nonnull final byte[] b) {
         Constraint.isNotNull(b, "byte[] data was null");
         
         int i = 0;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list