java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.cloudfront.PublicKey
All Implemented Interfaces:
IResource, IPublicKey, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-17T05:10:06.972Z") @Stability(Stable) public class PublicKey extends Resource implements IPublicKey
A Public Key Configuration.

Example:

 // Validating signed URLs or signed cookies with Trusted Key Groups
 // public key in PEM format
 String publicKey;
 PublicKey pubKey = PublicKey.Builder.create(this, "MyPubKey")
         .encodedKey(publicKey)
         .build();
 KeyGroup keyGroup = KeyGroup.Builder.create(this, "MyKeyGroup")
         .items(List.of(pubKey))
         .build();
 Distribution.Builder.create(this, "Dist")
         .defaultBehavior(BehaviorOptions.builder()
                 .origin(new HttpOrigin("www.example.com"))
                 .trustedKeyGroups(List.of(keyGroup))
                 .build())
         .build();
 
  • Constructor Details

    • PublicKey

      protected PublicKey(software.amazon.jsii.JsiiObjectRef objRef)
    • PublicKey

      protected PublicKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • PublicKey

      @Stability(Stable) public PublicKey(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull PublicKeyProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromPublicKeyId

      @Stability(Stable) @NotNull public static IPublicKey fromPublicKeyId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String publicKeyId)
      Imports a Public Key from its id.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      publicKeyId - This parameter is required.
    • getPublicKeyId

      @Stability(Stable) @NotNull public String getPublicKeyId()
      The ID of the key group.
      Specified by:
      getPublicKeyId in interface IPublicKey