-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add format selectable versions of getters for CA & CRL
- Loading branch information
Showing
7 changed files
with
156 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
extensions/vault/runtime/src/main/java/io/quarkus/vault/pki/CRLData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package io.quarkus.vault.pki; | ||
|
||
public interface CRLData { | ||
|
||
/** | ||
* Format of {@link #getData()} property. | ||
*/ | ||
DataFormat getFormat(); | ||
|
||
/** | ||
* Data in {@link DataFormat#PEM} or {@link DataFormat#DER} format. | ||
* | ||
* @see #getFormat() | ||
*/ | ||
Object getData(); | ||
|
||
/** | ||
* {@link DataFormat#DER} implementation of {@link CRLData} | ||
*/ | ||
class DER implements CRLData { | ||
|
||
private final byte[] derData; | ||
|
||
public DER(byte[] derData) { | ||
this.derData = derData; | ||
} | ||
|
||
@Override | ||
public DataFormat getFormat() { | ||
return DataFormat.DER; | ||
} | ||
|
||
@Override | ||
public byte[] getData() { | ||
return derData; | ||
} | ||
} | ||
|
||
/** | ||
* {@link DataFormat#PEM} implementation of {@link CRLData} | ||
*/ | ||
class PEM implements CRLData { | ||
|
||
private final String pemData; | ||
|
||
public PEM(String pemData) { | ||
this.pemData = pemData; | ||
} | ||
|
||
@Override | ||
public DataFormat getFormat() { | ||
return DataFormat.PEM; | ||
} | ||
|
||
@Override | ||
public String getData() { | ||
return pemData; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters