Class PublicKeyUtil
- java.lang.Object
-
- jetbrains.buildServer.controllers.PublicKeyUtil
-
public class PublicKeyUtil extends java.lang.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 java.lang.String
PUBLIC_KEY_EXPIRED_ERR
static java.lang.String
PUBLIC_KEY_PARAM
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
generatePublicKey()
Generates public key that should be set asPUBLIC_KEY_PARAM
argument to requeststatic boolean
isPublicKeyExpired(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 void
writePublicKeyExpiredError(org.jdom.Element xmlResponse)
Writes error with idPUBLIC_KEY_EXPIRED_ERR
to the specified XML response.
-
-
-
Field Detail
-
PUBLIC_KEY_PARAM
public static final java.lang.String PUBLIC_KEY_PARAM
- See Also:
- Constant Field Values
-
PUBLIC_KEY_EXPIRED_ERR
public static final java.lang.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_ERR
to 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 java.lang.String generatePublicKey()
Generates public key that should be set asPUBLIC_KEY_PARAM
argument to request- Returns:
- public key
-
-