Class PublicKeyUtil
- java.lang.Object
-
- jetbrains.buildServer.controllers.PublicKeyUtil
-
public class PublicKeyUtil extends Object
Utility class containing various methods used by controllers when working with server RSA public key.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPUBLIC_KEY_EXPIRED_ERRstatic StringPUBLIC_KEY_PARAM
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgeneratePublicKey()Generates public key that should be set asPUBLIC_KEY_PARAMargument to requeststatic booleanisPublicKeyExpired(javax.servlet.http.HttpServletRequest request)Compares public key from the request (parameter with name 'publicKey') and current public key used by the server and returns true if they are differ.static voidwritePublicKeyExpiredError(org.jdom.Element xmlResponse)Writes error with idPUBLIC_KEY_EXPIRED_ERRto the specified XML response.
-
-
-
Field Detail
-
PUBLIC_KEY_PARAM
public static final String PUBLIC_KEY_PARAM
- See Also:
- Constant Field Values
-
PUBLIC_KEY_EXPIRED_ERR
public static final String PUBLIC_KEY_EXPIRED_ERR
- See Also:
- Constant Field Values
-
-
Method Detail
-
isPublicKeyExpired
public static boolean isPublicKeyExpired(@NotNull javax.servlet.http.HttpServletRequest request)Compares public key from the request (parameter with name 'publicKey') and current public key used by the server and returns true if they are differ. This means that public key used by web page has expired (for example this can happen if server restarted).- Parameters:
request- request- Returns:
- true if public key specified in the request has expired
-
writePublicKeyExpiredError
public static void writePublicKeyExpiredError(@NotNull org.jdom.Element xmlResponse)Writes error with idPUBLIC_KEY_EXPIRED_ERRto the specified XML response. The content of this error will be public key currently used by the server.- Parameters:
xmlResponse- XML response
-
generatePublicKey
public static String generatePublicKey()
Generates public key that should be set asPUBLIC_KEY_PARAMargument to request- Returns:
- public key
-
-