11package org .bouncycastle .mail .smime ;
22
33import java .util .HashSet ;
4- import java .util .Set ;
54
65import javax .mail .MessagingException ;
76import javax .mail .internet .MimeBodyPart ;
1312
1413public class SMIMEEnvelopedUtil
1514{
16- private static Set <ASN1ObjectIdentifier > authOIDs = new HashSet <ASN1ObjectIdentifier >();
15+ private static final HashSet <ASN1ObjectIdentifier > AUTH_OIDS = new HashSet <ASN1ObjectIdentifier >();
1716
1817 static
1918 {
20- authOIDs .add (NISTObjectIdentifiers .id_aes128_GCM );
21- authOIDs .add (NISTObjectIdentifiers .id_aes128_GCM );
22- authOIDs .add (NISTObjectIdentifiers .id_aes128_GCM );
19+ AUTH_OIDS .add (NISTObjectIdentifiers .id_aes128_GCM );
20+ AUTH_OIDS .add (NISTObjectIdentifiers .id_aes192_GCM );
21+ AUTH_OIDS .add (NISTObjectIdentifiers .id_aes256_GCM );
2322 }
2423
2524 /**
@@ -32,7 +31,7 @@ public class SMIMEEnvelopedUtil
3231 */
3332 public static RecipientInformationStore getRecipientInfos (MimeBodyPart message ) throws MessagingException , CMSException
3433 {
35- if (message .getContentType ().equals (SMIMEAuthEnvelopedGenerator .AUTH_ENVELOPED_DATA_CONTENT_TYPE ))
34+ if (message .getContentType ().equals (SMIMEAuthEnvelopedGenerator .AUTH_ENVELOPED_DATA_CONTENT_TYPE ))
3635 {
3736 return new SMIMEAuthEnveloped (message ).getRecipientInfos ();
3837 }
@@ -48,7 +47,7 @@ public static RecipientInformationStore getRecipientInfos(MimeBodyPart message)
4847 */
4948 public static SMIMEEnvelopedGenerator createGenerator (ASN1ObjectIdentifier algorithm )
5049 {
51- if (authOIDs .contains (algorithm ))
50+ if (AUTH_OIDS .contains (algorithm ))
5251 {
5352 return new SMIMEAuthEnvelopedGenerator ();
5453 }
0 commit comments