package com.airlock.iam.saml2.application.configuration;

import com.airlock.iam.plugin.api.annotation.config.Plugin;
import com.airlock.iam.plugin.api.annotation.property.StringProperty;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Optional;

@Plugin(
   displayName = "RSA-OAEP Key Transport Algorithm",
   description = "The RSA-OAEP Key Transport algorithm ('http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p') is a public key encryption algorithm especially specified for encrypting and decrypting keys as described in the W3C Recommendation <a href=\"https://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#rsa-oaep-mgf1p\" target=\"_blank\">XML Encryption Syntax and Processing</a>."
)
public final class SamlRsaOaepKeyTransportAlgorithmConfig implements SamlKeyTransportAlgorithmConfig {
   @StringProperty(
      displayName = "OAEPparams",
      description = "<p>Encoding parameters P as described in <a href=\"https://www.ietf.org/rfc/rfc2437.txt\" target=\"_blank\">RFC 2437</a>.</p><p>Must be a Base64 encoded value.</p>",
      exampleValues = "9lWu3Q==",
      optional = true
   )
   private String oaepParams;

   public Optional<String> getOaepParams() {
      return Optional.ofNullable(this.oaepParams);
   }

   @SuppressFBWarnings(justification = "generated code")
   public static SamlRsaOaepKeyTransportAlgorithmConfig.SamlRsaOaepKeyTransportAlgorithmConfigBuilder builder() {
      return new SamlRsaOaepKeyTransportAlgorithmConfig.SamlRsaOaepKeyTransportAlgorithmConfigBuilder();
   }

   @SuppressFBWarnings(justification = "generated code")
   public SamlRsaOaepKeyTransportAlgorithmConfig() {
   }

   @SuppressFBWarnings(justification = "generated code")
   public SamlRsaOaepKeyTransportAlgorithmConfig(String oaepParams) {
      this.oaepParams = oaepParams;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class SamlRsaOaepKeyTransportAlgorithmConfigBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String oaepParams;

      @SuppressFBWarnings(justification = "generated code")
      SamlRsaOaepKeyTransportAlgorithmConfigBuilder() {
      }

      @SuppressFBWarnings(justification = "generated code")
      public SamlRsaOaepKeyTransportAlgorithmConfig.SamlRsaOaepKeyTransportAlgorithmConfigBuilder oaepParams(String oaepParams) {
         this.oaepParams = oaepParams;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public SamlRsaOaepKeyTransportAlgorithmConfig build() {
         return new SamlRsaOaepKeyTransportAlgorithmConfig(this.oaepParams);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "SamlRsaOaepKeyTransportAlgorithmConfig.SamlRsaOaepKeyTransportAlgorithmConfigBuilder(oaepParams=" + this.oaepParams + ")";
      }
   }
}
