INNER CODE UNIT · Go

resolvePrivateKeyPEM

hashicorp/terraform-provider-tls · internal/provider/common.go:35

func resolvePrivateKeyPEM(ctx context.Context, config tfsdk.Config, writeOnlyPath path.Path, plain types.String) (string, diag.Diagnostics) {
	var writeOnly types.String
	diags := config.GetAttribute(ctx, writeOnlyPath, &writeOnly)
	if diags.HasError() {
		return "", diags
	}
	if !writeOnly.IsNull() {
		return writeOnly.ValueString(), diags
	}
	return plain.ValueString(), diags
}

// hashForState computes the hexadecimal representation of the SHA1 checksum of a string.
// This is used by most resources/data-sources here to compute their Unique Identifier (ID).
func hashForState(value string) string {
	if value == "" {
		return ""
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…