Class ServerIdentity
java.lang.Object
org.cloudburstmc.netty.util.nethernet.ServerIdentity
Produces the server-side identity assertion for each SDP answer
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionServerIdentity(PrivateKey privateKey, PublicKey publicKey, Instant expiry, String domain) -
Method Summary
Modifier and TypeMethodDescriptionaugmentAnswer(String answerSdp) Insert the identity into the answer SDP The specific placement is a strange requirement for the spec but we will follow itstatic ServerIdentityfromKeystore(File keystore, String password) Loads the keypair from the first key entry of a PKCS12 keystore.static ServerIdentityGenerate a brand-new server identity that is not storedidentityValue(String answerSdp) Generate the identity value as base64 for this answer SDP
-
Constructor Details
-
ServerIdentity
public ServerIdentity(PrivateKey privateKey, PublicKey publicKey, Instant expiry, String domain) throws org.jose4j.lang.JoseException - Throws:
org.jose4j.lang.JoseException
-
-
Method Details
-
fromKeystore
public static ServerIdentity fromKeystore(File keystore, String password) throws GeneralSecurityException, IOException, org.jose4j.lang.JoseException Loads the keypair from the first key entry of a PKCS12 keystore.- Parameters:
keystore- The PKCS12 keystore filepassword- The keystore password- Returns:
- The loaded ServerIdentity
- Throws:
GeneralSecurityException- If there is a security errorIOException- If there is an I/O errororg.jose4j.lang.JoseException- If there is an error creating the JWT
-
generate
Generate a brand-new server identity that is not stored- Parameters:
domain- The domain name for the server identity- Returns:
- A new ServerIdentity instance
- Throws:
org.jose4j.lang.JoseException- If there is an error creating the JWT
-
identityValue
Generate the identity value as base64 for this answer SDP- Parameters:
answerSdp- The SDP to generate the identity value for- Returns:
- The base64 identity value
- Throws:
org.jose4j.lang.JoseException- If there is an error signing the identity value
-
augmentAnswer
Insert the identity into the answer SDP The specific placement is a strange requirement for the spec but we will follow it- Parameters:
answerSdp- The SDP to insert the identity into- Returns:
- The SDP with the identity inserted
- Throws:
org.jose4j.lang.JoseException- If there is an error signing the identity value
-