All Downloads are FREE. Search and download functionalities are using the official Maven repository.

RawRSAKeyring_Compile.RsaGenerateAndWrapKeyMaterial Maven / Gradle / Ivy

// Class RsaGenerateAndWrapKeyMaterial
// Dafny class RsaGenerateAndWrapKeyMaterial compiled into Java
package RawRSAKeyring_Compile;

import software.amazon.cryptography.keystore.internaldafny.types.*;
import software.amazon.cryptography.materialproviders.internaldafny.types.*;
import AwsArnParsing_Compile.*;
import AwsKmsMrkMatchForDecrypt_Compile.*;
import AwsKmsUtils_Compile.*;
import KeyStoreErrorMessages_Compile.*;
import KmsArn_Compile.*;
import Structure_Compile.*;
import KMSKeystoreOperations_Compile.*;
import DDBKeystoreOperations_Compile.*;
import CreateKeys_Compile.*;
import CreateKeyStoreTable_Compile.*;
import GetKeys_Compile.*;
import AwsCryptographyKeyStoreOperations_Compile.*;
import software.amazon.cryptography.keystore.internaldafny.*;
import AlgorithmSuites_Compile.*;
import Materials_Compile.*;
import Keyring_Compile.*;
import MultiKeyring_Compile.*;
import AwsKmsMrkAreUnique_Compile.*;
import Constants_Compile.*;
import MaterialWrapping_Compile.*;
import CanonicalEncryptionContext_Compile.*;
import IntermediateKeyWrapping_Compile.*;
import EdkWrapping_Compile.*;
import ErrorMessages_Compile.*;
import AwsKmsKeyring_Compile.*;
import StrictMultiKeyring_Compile.*;
import AwsKmsDiscoveryKeyring_Compile.*;
import DiscoveryMultiKeyring_Compile.*;
import AwsKmsMrkDiscoveryKeyring_Compile.*;
import MrkAwareDiscoveryMultiKeyring_Compile.*;
import AwsKmsMrkKeyring_Compile.*;
import MrkAwareStrictMultiKeyring_Compile.*;
import LocalCMC_Compile.*;
import StormTracker_Compile.*;
import software.amazon.cryptography.internaldafny.StormTrackingCMC.*;
import CacheConstants_Compile.*;
import AwsKmsHierarchicalKeyring_Compile.*;
import AwsKmsRsaKeyring_Compile.*;
import EcdhEdkWrapping_Compile.*;
import RawECDHKeyring_Compile.*;
import AwsKmsEcdhKeyring_Compile.*;
import RawAESKeyring_Compile.*;

@SuppressWarnings({"unchecked", "deprecation"})
public class RsaGenerateAndWrapKeyMaterial implements MaterialWrapping_Compile.GenerateAndWrapMaterial, Actions_Compile.ActionWithResult, software.amazon.cryptography.materialproviders.internaldafny.types.Error>, Actions_Compile.Action, software.amazon.cryptography.materialproviders.internaldafny.types.Error>> {
  public RsaGenerateAndWrapKeyMaterial() {
    this._publicKey = dafny.DafnySequence. empty(BoundedInts_Compile.uint8._typeDescriptor());
    this._paddingScheme = software.amazon.cryptography.primitives.internaldafny.types.RSAPaddingMode.Default();
    this._cryptoPrimitives = null;
  }
  public void __ctor(dafny.DafnySequence publicKey, software.amazon.cryptography.primitives.internaldafny.types.RSAPaddingMode paddingScheme, software.amazon.cryptography.primitives.internaldafny.AtomicPrimitivesClient cryptoPrimitives)
  {
    (this)._publicKey = publicKey;
    (this)._paddingScheme = paddingScheme;
    (this)._cryptoPrimitives = cryptoPrimitives;
  }
  public Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> Invoke(MaterialWrapping_Compile.GenerateAndWrapInput input)
  {
    Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> res = Wrappers_Compile.Result., software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(MaterialWrapping_Compile.GenerateAndWrapOutput._typeDescriptor(RsaWrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), MaterialWrapping_Compile.GenerateAndWrapOutput.Default(RsaWrapInfo._typeDescriptor(), RsaWrapInfo.Default()));
    Wrappers_Compile.Result, software.amazon.cryptography.primitives.internaldafny.types.Error> _0_generateBytesResult;
    Wrappers_Compile.Result, software.amazon.cryptography.primitives.internaldafny.types.Error> _out0;
    _out0 = ((this).cryptoPrimitives()).GenerateRandomBytes(software.amazon.cryptography.primitives.internaldafny.types.GenerateRandomBytesInput.create(AlgorithmSuites_Compile.__default.GetEncryptKeyLength((input).dtor_algorithmSuite())));
    _0_generateBytesResult = _out0;
    Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _1_valueOrError0 = Wrappers_Compile.Result., software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence. empty(BoundedInts_Compile.uint8._typeDescriptor()));
    _1_valueOrError0 = (_0_generateBytesResult).MapFailure(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.primitives.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((java.util.function.Function)(_2_e_boxed0) -> {
      software.amazon.cryptography.primitives.internaldafny.types.Error _2_e = ((software.amazon.cryptography.primitives.internaldafny.types.Error)(java.lang.Object)(_2_e_boxed0));
      return software.amazon.cryptography.materialproviders.internaldafny.types.Error.create_AwsCryptographyPrimitives(_2_e);
    }));
    if ((_1_valueOrError0).IsFailure(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
      res = (_1_valueOrError0).>PropagateFailure(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), MaterialWrapping_Compile.GenerateAndWrapOutput._typeDescriptor(RsaWrapInfo._typeDescriptor()));
      return res;
    }
    dafny.DafnySequence _3_plaintextMaterial;
    _3_plaintextMaterial = (_1_valueOrError0).Extract(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
    RsaWrapKeyMaterial _4_wrap;
    RsaWrapKeyMaterial _nw0 = new RsaWrapKeyMaterial();
    _nw0.__ctor((this).publicKey(), (this).paddingScheme(), (this).cryptoPrimitives());
    _4_wrap = _nw0;
    Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _5_valueOrError1 = Wrappers_Compile.Result., software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(MaterialWrapping_Compile.WrapOutput._typeDescriptor(RsaWrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), MaterialWrapping_Compile.WrapOutput.Default(RsaWrapInfo._typeDescriptor(), RsaWrapInfo.Default()));
    Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _out1;
    _out1 = (_4_wrap).Invoke(MaterialWrapping_Compile.WrapInput.create(_3_plaintextMaterial, (input).dtor_algorithmSuite(), (input).dtor_encryptionContext()));
    _5_valueOrError1 = _out1;
    if ((_5_valueOrError1).IsFailure(MaterialWrapping_Compile.WrapOutput._typeDescriptor(RsaWrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
      res = (_5_valueOrError1).>PropagateFailure(MaterialWrapping_Compile.WrapOutput._typeDescriptor(RsaWrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), MaterialWrapping_Compile.GenerateAndWrapOutput._typeDescriptor(RsaWrapInfo._typeDescriptor()));
      return res;
    }
    MaterialWrapping_Compile.WrapOutput _6_wrapOutput;
    _6_wrapOutput = (_5_valueOrError1).Extract(MaterialWrapping_Compile.WrapOutput._typeDescriptor(RsaWrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
    MaterialWrapping_Compile.GenerateAndWrapOutput _7_output;
    _7_output = MaterialWrapping_Compile.GenerateAndWrapOutput.create(RsaWrapInfo._typeDescriptor(), _3_plaintextMaterial, (_6_wrapOutput).dtor_wrappedMaterial(), RawRSAKeyring_Compile.RsaWrapInfo.create());
    res = Wrappers_Compile.Result., software.amazon.cryptography.materialproviders.internaldafny.types.Error>create_Success(MaterialWrapping_Compile.GenerateAndWrapOutput._typeDescriptor(RsaWrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), _7_output);
    return res;
  }
  public dafny.DafnySequence _publicKey;
  public dafny.DafnySequence publicKey()
  {
    return this._publicKey;
  }
  public software.amazon.cryptography.primitives.internaldafny.types.RSAPaddingMode _paddingScheme;
  public software.amazon.cryptography.primitives.internaldafny.types.RSAPaddingMode paddingScheme()
  {
    return this._paddingScheme;
  }
  public software.amazon.cryptography.primitives.internaldafny.AtomicPrimitivesClient _cryptoPrimitives;
  public software.amazon.cryptography.primitives.internaldafny.AtomicPrimitivesClient cryptoPrimitives()
  {
    return this._cryptoPrimitives;
  }
  private static final dafny.TypeDescriptor _TYPE = dafny.TypeDescriptor.referenceWithInitializer(RsaGenerateAndWrapKeyMaterial.class, () -> (RsaGenerateAndWrapKeyMaterial) null);
  public static dafny.TypeDescriptor _typeDescriptor() {
    return (dafny.TypeDescriptor) (dafny.TypeDescriptor) _TYPE;
  }
  @Override
  public java.lang.String toString() {
    return "RawRSAKeyring.RsaGenerateAndWrapKeyMaterial";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy