-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maciej Mierzwa <dev.maciej.mierzwa@gmail.com>
- Loading branch information
1 parent
c335f08
commit cf8d2c9
Showing
5 changed files
with
87 additions
and
363 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
71 changes: 71 additions & 0 deletions
71
src/main/java/org/opensearch/security/securityconf/impl/OnBehalfOf.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,71 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.security.securityconf.impl; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
|
||
import org.opensearch.security.DefaultObjectMapper; | ||
|
||
public class OnBehalfOf { | ||
@JsonProperty("encryption_key") | ||
public String encryptionKey; | ||
@JsonProperty | ||
public String algorithm; | ||
//HMAC | ||
@JsonProperty("signing_key") | ||
public String signingKey; | ||
//EC | ||
@JsonProperty("ec_private_key") | ||
public String ecPrivateKey; | ||
@JsonProperty("ec_private") | ||
public String ecPrivate; | ||
@JsonProperty("ec_x") | ||
public String ecXCoordinate; | ||
@JsonProperty("ec_y") | ||
public String ecYCoordinate; | ||
//RSA | ||
@JsonProperty("rsa_private_key") | ||
public String rsaPrivateKey; | ||
@JsonProperty("rsa_modulus") | ||
public String rsaModulus; | ||
@JsonProperty("rsa_public_exp") | ||
public String rsaPublicExp; | ||
@JsonProperty("rsa_private_exp") | ||
public String rsaPrivateExp; | ||
@JsonProperty("rsa_first_prime_factor") | ||
public String rsaFirstPrimeFactor; | ||
@JsonProperty("rsa_second_prime_factor") | ||
public String rsaSecondPrimeFactor; | ||
@JsonProperty("rsa_first_prime_crt") | ||
public String rsaFirstPrimeCrt; | ||
@JsonProperty("rsa_second_prime_crt") | ||
public String rsaSecondPrimeCrt; | ||
@JsonProperty("rsa_first_crt_coefficient") | ||
public String rsaFirstCrtCoefficient; | ||
|
||
@JsonIgnore | ||
public String configAsJson() { | ||
try { | ||
return DefaultObjectMapper.writeValueAsString(this, false); | ||
} catch (JsonProcessingException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "OnBehalfOf [signing_key=" + signingKey + ", encryption_key=" + encryptionKey + ", algorithm=" + algorithm + | ||
", signing_key=" + signingKey + ", ec_private_key=" + ecPrivateKey + ", ec_private=" + ecPrivate + ", ec_x=" + ecXCoordinate + ", ec_y=" + ecYCoordinate + ", rsa_private_key=" + rsaPrivateKey + | ||
", rsa_modulus=" + rsaModulus + ", rsa_public_exp=" + rsaPublicExp + ", rsa_private_exp=" + rsaPrivateExp + | ||
", rsa_first_prime_factor=" + rsaFirstPrimeFactor + ", rsa_second_prime_factor=" + rsaSecondPrimeFactor + | ||
", rsa_first_prime_crt=" + rsaFirstPrimeCrt + ", rsa_second_prime_crt=" + rsaSecondPrimeCrt + ", rsa_first_crt_coefficient=" + rsaFirstCrtCoefficient + "]"; | ||
} | ||
} |
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
Oops, something went wrong.