Skip to content

Commit acc9e54

Browse files
author
SDKAuto
committed
CodeGen from PR 32742 in Azure/azure-rest-api-specs
Merge 81cda2afd46d8a5b273dd40a97941c734c2c99ca into f733e0a7da1abf3d99ed2d7e82b620fa9cc7c243
1 parent 1632db4 commit acc9e54

File tree

6 files changed

+1098
-14
lines changed

6 files changed

+1098
-14
lines changed

sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md

Lines changed: 464 additions & 4 deletions
Large diffs are not rendered by default.

sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/KeyClientImpl.java

Lines changed: 441 additions & 6 deletions
Large diffs are not rendered by default.

sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/models/JsonWebKeySignatureAlgorithm.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,22 @@ public static JsonWebKeySignatureAlgorithm fromString(String name) {
109109
public static Collection<JsonWebKeySignatureAlgorithm> values() {
110110
return values(JsonWebKeySignatureAlgorithm.class);
111111
}
112+
113+
/**
114+
* HMAC using SHA-256, as described in https://tools.ietf.org/html/rfc7518.
115+
*/
116+
@Generated
117+
public static final JsonWebKeySignatureAlgorithm HS256 = fromString("HS256");
118+
119+
/**
120+
* HMAC using SHA-384, as described in https://tools.ietf.org/html/rfc7518.
121+
*/
122+
@Generated
123+
public static final JsonWebKeySignatureAlgorithm HS384 = fromString("HS384");
124+
125+
/**
126+
* HMAC using SHA-512, as described in https://tools.ietf.org/html/rfc7518.
127+
*/
128+
@Generated
129+
public static final JsonWebKeySignatureAlgorithm HS512 = fromString("HS512");
112130
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.security.keyvault.keys.implementation.models;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.annotation.Immutable;
9+
import com.azure.core.util.Base64Url;
10+
import com.azure.json.JsonReader;
11+
import com.azure.json.JsonSerializable;
12+
import com.azure.json.JsonToken;
13+
import com.azure.json.JsonWriter;
14+
import java.io.IOException;
15+
import java.util.Objects;
16+
17+
/**
18+
* The key attestation information.
19+
*/
20+
@Immutable
21+
public final class KeyAttestation implements JsonSerializable<KeyAttestation> {
22+
/*
23+
* A base64url-encoded string containing certificates in PEM format, used for attestation validation.
24+
*/
25+
@Generated
26+
private Base64Url certificatePemFile;
27+
28+
/*
29+
* The attestation blob bytes encoded as base64url string corresponding to a private key.
30+
*/
31+
@Generated
32+
private Base64Url privateKeyAttestation;
33+
34+
/*
35+
* The attestation blob bytes encoded as base64url string corresponding to a public key in case of asymmetric key.
36+
*/
37+
@Generated
38+
private Base64Url publicKeyAttestation;
39+
40+
/*
41+
* The version of the attestation.
42+
*/
43+
@Generated
44+
private String version;
45+
46+
/**
47+
* Creates an instance of KeyAttestation class.
48+
*/
49+
@Generated
50+
private KeyAttestation() {
51+
}
52+
53+
/**
54+
* Get the certificatePemFile property: A base64url-encoded string containing certificates in PEM format, used for
55+
* attestation validation.
56+
*
57+
* @return the certificatePemFile value.
58+
*/
59+
@Generated
60+
public byte[] getCertificatePemFile() {
61+
if (this.certificatePemFile == null) {
62+
return null;
63+
}
64+
return this.certificatePemFile.decodedBytes();
65+
}
66+
67+
/**
68+
* Get the privateKeyAttestation property: The attestation blob bytes encoded as base64url string corresponding to a
69+
* private key.
70+
*
71+
* @return the privateKeyAttestation value.
72+
*/
73+
@Generated
74+
public byte[] getPrivateKeyAttestation() {
75+
if (this.privateKeyAttestation == null) {
76+
return null;
77+
}
78+
return this.privateKeyAttestation.decodedBytes();
79+
}
80+
81+
/**
82+
* Get the publicKeyAttestation property: The attestation blob bytes encoded as base64url string corresponding to a
83+
* public key in case of asymmetric key.
84+
*
85+
* @return the publicKeyAttestation value.
86+
*/
87+
@Generated
88+
public byte[] getPublicKeyAttestation() {
89+
if (this.publicKeyAttestation == null) {
90+
return null;
91+
}
92+
return this.publicKeyAttestation.decodedBytes();
93+
}
94+
95+
/**
96+
* Get the version property: The version of the attestation.
97+
*
98+
* @return the version value.
99+
*/
100+
@Generated
101+
public String getVersion() {
102+
return this.version;
103+
}
104+
105+
/**
106+
* {@inheritDoc}
107+
*/
108+
@Generated
109+
@Override
110+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
111+
jsonWriter.writeStartObject();
112+
jsonWriter.writeStringField("certificatePemFile", Objects.toString(this.certificatePemFile, null));
113+
jsonWriter.writeStringField("privateKeyAttestation", Objects.toString(this.privateKeyAttestation, null));
114+
jsonWriter.writeStringField("publicKeyAttestation", Objects.toString(this.publicKeyAttestation, null));
115+
jsonWriter.writeStringField("version", this.version);
116+
return jsonWriter.writeEndObject();
117+
}
118+
119+
/**
120+
* Reads an instance of KeyAttestation from the JsonReader.
121+
*
122+
* @param jsonReader The JsonReader being read.
123+
* @return An instance of KeyAttestation if the JsonReader was pointing to an instance of it, or null if it was
124+
* pointing to JSON null.
125+
* @throws IOException If an error occurs while reading the KeyAttestation.
126+
*/
127+
@Generated
128+
public static KeyAttestation fromJson(JsonReader jsonReader) throws IOException {
129+
return jsonReader.readObject(reader -> {
130+
KeyAttestation deserializedKeyAttestation = new KeyAttestation();
131+
while (reader.nextToken() != JsonToken.END_OBJECT) {
132+
String fieldName = reader.getFieldName();
133+
reader.nextToken();
134+
135+
if ("certificatePemFile".equals(fieldName)) {
136+
deserializedKeyAttestation.certificatePemFile
137+
= reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString()));
138+
} else if ("privateKeyAttestation".equals(fieldName)) {
139+
deserializedKeyAttestation.privateKeyAttestation
140+
= reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString()));
141+
} else if ("publicKeyAttestation".equals(fieldName)) {
142+
deserializedKeyAttestation.publicKeyAttestation
143+
= reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString()));
144+
} else if ("version".equals(fieldName)) {
145+
deserializedKeyAttestation.version = reader.getString();
146+
} else {
147+
reader.skipChildren();
148+
}
149+
}
150+
151+
return deserializedKeyAttestation;
152+
});
153+
}
154+
}

sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/implementation/models/KeyAttributes.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,29 @@ public static KeyAttributes fromJson(JsonReader jsonReader) throws IOException {
294294
deserializedKeyAttributes.exportable = reader.getNullable(JsonReader::getBoolean);
295295
} else if ("hsmPlatform".equals(fieldName)) {
296296
deserializedKeyAttributes.hsmPlatform = reader.getString();
297+
} else if ("attestation".equals(fieldName)) {
298+
deserializedKeyAttributes.attestation = KeyAttestation.fromJson(reader);
297299
} else {
298300
reader.skipChildren();
299301
}
300302
}
301303
return deserializedKeyAttributes;
302304
});
303305
}
306+
307+
/*
308+
* The key or key version attestation information.
309+
*/
310+
@Generated
311+
private KeyAttestation attestation;
312+
313+
/**
314+
* Get the attestation property: The key or key version attestation information.
315+
*
316+
* @return the attestation value.
317+
*/
318+
@Generated
319+
public KeyAttestation getAttestation() {
320+
return this.attestation;
321+
}
304322
}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
directory: specification/keyvault/Security.KeyVault.Keys
2-
commit: a0eb4f02951e8b7dd80e72e108b9cf7618718bc9
2+
commit: 21ffc3434a86c2363e7bcdb1217d36b98ca36280
33
repo: Azure/azure-rest-api-specs
4-
cleanup: true
5-
additionalDirectories:
6-
- specification/keyvault/Security.KeyVault.Common/
4+
additionalDirectories:
5+
- specification/keyvault/Security.KeyVault.Common

0 commit comments

Comments
 (0)