public class BndAuthentication extends DefaultURLConnectionHandler
Settings.
This URL Connection Handler plugin will use this information to add signing
information to the URL.
We add a X_A_QUTE_AUTHORIZATION header with a formatted string that
contains the email of the user, the machine name (for documentation), the
public key, and a signed date header (SHA1WithRSA). This information can be
parameterized with the following plugin properties or the default settings
can be used.
MATCH — URL
matcher
email — Email address of the account holder
privateKey — Hex private RSA key
publicKey — Hex public RSA key
machine — Machine name (defaults to the internet name of this
machine as returned by invoking InetAddress.getHostName() on the
InetAddress returned by InetAddress.getLocalHost())
| Modifier and Type | Class and Description |
|---|---|
(package private) static interface |
BndAuthentication.Config |
Reporter.SetLocationReport.Location| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
email |
private static java.lang.String |
EMAIL |
private static java.text.SimpleDateFormat |
httpFormat |
private java.lang.String |
identity |
private static org.slf4j.Logger |
logger |
private java.lang.String |
machine |
private static java.lang.String |
MACHINE |
private static java.lang.String |
PRIVATE_KEY |
private java.security.PrivateKey |
privateKey |
private static java.lang.String |
PUBLIC_KEY |
private java.security.PublicKey |
publicKey |
private static java.lang.String |
X_A_QUTE_AUTHORIZATION |
registryMATCH| Constructor and Description |
|---|
BndAuthentication() |
| Modifier and Type | Method and Description |
|---|---|
private void |
credentials(java.lang.String email,
byte[] publicKey,
byte[] privateKey) |
void |
handle(java.net.URLConnection connection)
Not doing anything is perfect ok
|
private void |
init() |
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> map)
Set the properties for this plugin.
|
error, exception, getErrors, getLocation, getWarnings, isOk, isPedantic, matches, matches, progress, setRegistry, setReporter, trace, warningprivate static final org.slf4j.Logger logger
private static final java.lang.String MACHINE
private static final java.lang.String PRIVATE_KEY
private static final java.lang.String PUBLIC_KEY
private static final java.lang.String EMAIL
private static java.text.SimpleDateFormat httpFormat
private static final java.lang.String X_A_QUTE_AUTHORIZATION
private java.lang.String identity
private java.lang.String email
private java.lang.String machine
private java.security.PrivateKey privateKey
private java.security.PublicKey publicKey
public void handle(java.net.URLConnection connection)
throws java.lang.Exception
DefaultURLConnectionHandlerhandle in interface URLConnectionHandlerhandle in class DefaultURLConnectionHandlerconnection - The connection to modifyjava.lang.Exceptionprivate void init()
throws java.net.UnknownHostException
java.net.UnknownHostExceptionpublic void setProperties(java.util.Map<java.lang.String,java.lang.String> map)
throws java.lang.Exception
DefaultURLConnectionHandlersetProperties in interface PluginsetProperties in class DefaultURLConnectionHandlermap - attributes and directives for this plugin's clausejava.lang.Exceptionprivate void credentials(java.lang.String email,
byte[] publicKey,
byte[] privateKey)
throws java.security.spec.InvalidKeySpecException,
java.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecExceptionjava.security.NoSuchAlgorithmException