Home / Function/ createKeySpecForPkcs8() — spring-boot Function Reference

createKeySpecForPkcs8() — spring-boot Function Reference

Architecture documentation for the createKeySpecForPkcs8() function in PemPrivateKeyParser.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  591cf155_2524_593e_9cfa_d72971d42557["createKeySpecForPkcs8()"]
  ed749d20_3b57_5c21_8f27_e679be9d1233["isType()"]
  591cf155_2524_593e_9cfa_d72971d42557 -->|calls| ed749d20_3b57_5c21_8f27_e679be9d1233
  e240e0f6_b4ee_a57c_4a0a_a603fa8cc7cb["getContents()"]
  591cf155_2524_593e_9cfa_d72971d42557 -->|calls| e240e0f6_b4ee_a57c_4a0a_a603fa8cc7cb
  5400b146_9639_7c2b_1f4c_7ea4047bfee9["of()"]
  591cf155_2524_593e_9cfa_d72971d42557 -->|calls| 5400b146_9639_7c2b_1f4c_7ea4047bfee9
  style 591cf155_2524_593e_9cfa_d72971d42557 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/ssl/PemPrivateKeyParser.java lines 167–183

	private static PKCS8EncodedKeySpec createKeySpecForPkcs8(byte[] bytes, @Nullable String password) {
		DerElement ecPrivateKey = DerElement.of(bytes);
		Assert.state(ecPrivateKey != null, "Unable to find private key");
		Assert.state(ecPrivateKey.isType(ValueType.ENCODED, TagType.SEQUENCE),
				"Key spec should be an ASN.1 encoded sequence");
		DerElement version = DerElement.of(ecPrivateKey.getContents());
		Assert.state(version != null && version.isType(ValueType.PRIMITIVE, TagType.INTEGER),
				"Key spec should start with version");
		DerElement sequence = DerElement.of(ecPrivateKey.getContents());
		Assert.state(sequence != null && sequence.isType(ValueType.ENCODED, TagType.SEQUENCE),
				"Key spec should contain private key");
		DerElement algorithmId = DerElement.of(sequence.getContents());
		Assert.state(algorithmId != null && algorithmId.isType(ValueType.PRIMITIVE, TagType.OBJECT_IDENTIFIER),
				"Key spec container object identifier");
		String algorithmName = ALGORITHMS.get(EncodedOid.of(algorithmId));
		return (algorithmName != null) ? new PKCS8EncodedKeySpec(bytes, algorithmName) : new PKCS8EncodedKeySpec(bytes);
	}

Subdomains

Frequently Asked Questions

What does createKeySpecForPkcs8() do?
createKeySpecForPkcs8() is a function in the spring-boot codebase.
What does createKeySpecForPkcs8() call?
createKeySpecForPkcs8() calls 3 function(s): getContents, isType, of.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free