@Test public void testCreateKeyStores () throws GeneralSecurityException { final BCCryptoHelper x = new BCCryptoHelper (); for (final EKeyStoreType e : EKeyStoreType.values ()) { assertNotNull (x.createNewKeyStore (e)); } }
@Nonnull public KeyStore createNewKeyStore (@Nonnull final IKeyStoreType aKeyStoreType) throws GeneralSecurityException { try { return aKeyStoreType.getKeyStore (m_sSecurityProviderName); } catch (final Exception ex) { return aKeyStoreType.getKeyStore (); } }
BCCryptoHelper implements ICryptoHelper { @Nonnull public KeyStore createNewKeyStore (@Nonnull final IKeyStoreType aKeyStoreType) throws GeneralSecurityException { try { return aKeyStoreType.getKeyStore (m_sSecurityProviderName); } catch (final Exception ex) { return aKeyStoreType.getKeyStore (); } } }
BCCryptoHelper implements ICryptoHelper { @Nonnull public KeyStore createNewKeyStore (@Nonnull final IKeyStoreType aKeyStoreType) throws GeneralSecurityException { try { return aKeyStoreType.getKeyStore (m_sSecurityProviderName); } catch (final Exception ex) { return aKeyStoreType.getKeyStore (); } } BCCryptoHelper(); }
BCCryptoHelper implements ICryptoHelper { @Nonnull public KeyStore createNewKeyStore (@Nonnull final IKeyStoreType aKeyStoreType) throws GeneralSecurityException { try { return aKeyStoreType.getKeyStore (m_sSecurityProviderName); } catch (final Exception ex) { return aKeyStoreType.getKeyStore (); } } BCCryptoHelper(); @Nonnull @Nonempty String getSecurityProviderName(); @Nonnull BCCryptoHelper setSecurityProviderName(@Nonnull @Nonempty final String sSecurityProviderName); @Nonnull KeyStore createNewKeyStore(@Nonnull final IKeyStoreType aKeyStoreType); @Nonnull KeyStore loadKeyStore(@Nonnull final IKeyStoreType aKeyStoreType,
                                @Nullable @WillNotClose final InputStream aIS,
                                @Nonnull final char [] aPassword); boolean isEncrypted(@Nonnull final MimeBodyPart aPart); boolean isSigned(@Nonnull final MimeBodyPart aPart); boolean isCompressed(@Nonnull final String sContentType); @Nonnull MIC calculateMIC(@Nonnull final MimeBodyPart aPart,
                           @Nonnull final ECryptoAlgorithmSign eDigestAlgorithm,
                           final boolean bIncludeHeaders); @Nonnull MimeBodyPart decrypt(@Nonnull final MimeBodyPart aPart,
                               @Nonnull final X509Certificate aX509Cert,
                               @Nonnull final PrivateKey aPrivateKey,
                               final boolean bForceDecrypt,
                               @Nonnull final AS2ResourceHelper aResHelper); @Nonnull MimeBodyPart encrypt(@Nonnull final MimeBodyPart aPart,
                               @Nonnull final X509Certificate aX509Cert,
                               @Nonnull final ECryptoAlgorithmCrypt eAlgorithm,
                               @Nonnull final EContentTransferEncoding eCTE); @Nonnull MimeBodyPart sign(@Nonnull final MimeBodyPart aPart,
                            @Nonnull final X509Certificate aX509Cert,
                            @Nonnull final PrivateKey aPrivateKey,
                            @Nonnull final ECryptoAlgorithmSign eAlgorithm,
                            final boolean bIncludeCertificateInSignedContent,
                            final boolean bUseOldRFC3851MicAlgs,
                            @Nonnull final EContentTransferEncoding eCTE); @Nonnull MimeBodyPart verify(@Nonnull final MimeBodyPart aPart,
                              @Nullable final X509Certificate aX509Cert,
                              final boolean bUseCertificateInBodyPart,
                              final boolean bForceVerify,
                              @Nullable final Consumer <X509Certificate> aEffectiveCertificateConsumer,
                              @Nonnull final AS2ResourceHelper aResHelper); }
BCCryptoHelper implements ICryptoHelper { @Nonnull public KeyStore createNewKeyStore (@Nonnull final IKeyStoreType aKeyStoreType) throws GeneralSecurityException { try { return aKeyStoreType.getKeyStore (m_sSecurityProviderName); } catch (final Exception ex) { return aKeyStoreType.getKeyStore (); } } BCCryptoHelper(); @Nonnull @Nonempty String getSecurityProviderName(); @Nonnull BCCryptoHelper setSecurityProviderName(@Nonnull @Nonempty final String sSecurityProviderName); @Nonnull KeyStore createNewKeyStore(@Nonnull final IKeyStoreType aKeyStoreType); @Nonnull KeyStore loadKeyStore(@Nonnull final IKeyStoreType aKeyStoreType,
                                @Nullable @WillNotClose final InputStream aIS,
                                @Nonnull final char [] aPassword); boolean isEncrypted(@Nonnull final MimeBodyPart aPart); boolean isSigned(@Nonnull final MimeBodyPart aPart); boolean isCompressed(@Nonnull final String sContentType); @Nonnull MIC calculateMIC(@Nonnull final MimeBodyPart aPart,
                           @Nonnull final ECryptoAlgorithmSign eDigestAlgorithm,
                           final boolean bIncludeHeaders); @Nonnull MimeBodyPart decrypt(@Nonnull final MimeBodyPart aPart,
                               @Nonnull final X509Certificate aX509Cert,
                               @Nonnull final PrivateKey aPrivateKey,
                               final boolean bForceDecrypt,
                               @Nonnull final AS2ResourceHelper aResHelper); @Nonnull MimeBodyPart encrypt(@Nonnull final MimeBodyPart aPart,
                               @Nonnull final X509Certificate aX509Cert,
                               @Nonnull final ECryptoAlgorithmCrypt eAlgorithm,
                               @Nonnull final EContentTransferEncoding eCTE); @Nonnull MimeBodyPart sign(@Nonnull final MimeBodyPart aPart,
                            @Nonnull final X509Certificate aX509Cert,
                            @Nonnull final PrivateKey aPrivateKey,
                            @Nonnull final ECryptoAlgorithmSign eAlgorithm,
                            final boolean bIncludeCertificateInSignedContent,
                            final boolean bUseOldRFC3851MicAlgs,
                            @Nonnull final EContentTransferEncoding eCTE); @Nonnull MimeBodyPart verify(@Nonnull final MimeBodyPart aPart,
                              @Nullable final X509Certificate aX509Cert,
                              final boolean bUseCertificateInBodyPart,
                              final boolean bForceVerify,
                              @Nullable final Consumer <X509Certificate> aEffectiveCertificateConsumer,
                              @Nonnull final AS2ResourceHelper aResHelper);  }