code: public static KeyStoreConfig fromOrganizationCertificate(final InputStream organizationCertificateStream, final String privatekeyPassword) {
          KeyStore ks = KeyStoreType.PKCS12.loadKeyStore(organizationCertificateStream, privatekeyPassword);
          Enumeration<String> aliases;
          try {
              aliases = ks.aliases();
          } catch (KeyStoreException e) {
              throw new KeyException(
                      "Could not retrieve aliases from the key store, because " + e.getClass().getSimpleName() + ": " +
                      "'" + e.getMessage() + "'. Are you sure this is an organization certificate in PKCS12 format?", e);
          }
          if (!aliases.hasMoreElements()) {
              throw new KeyException("The keystore contains no aliases, i.e. is empty! Are you sure this is an organization certificate in PKCS12 format?");
          }
          String keyName = aliases.nextElement();
          return new KeyStoreConfig(ks, keyName, privatekeyPassword, privatekeyPassword);
      }
docs: Create a {@link KeyStoreConfig} from an Organization Certificate (Virksomhetssertifikat).
  
  @param organizationCertificateStream A stream of the certificate in PKCS12 format. The file should have .p12-file ending.
  @param privatekeyPassword            The password for the private key of the organization certificate.
  @return The config, containing the certificate, the private key and the certificate chain.