public abstract class NetSecurityManager extends Object
NetworkInterface.getType()
is MOCA the implementation SHALL associate the getNetworkPassword and
setNetworkPassword methods in this interface to the MoCA link layer password
used for the network interface. When the network interface type returned by
NetworkInterface.getType() is WIRELESS_ETHERNET the
implementation SHALL associate the getNetworkPassword and setNetworkPassword
in this interface to the link layer password, e.g. WEP, used for the
network interface.
This class also permits privileged applications to register a handler to authorize home network activity.
| Modifier | Constructor and Description |
|---|---|
protected |
NetSecurityManager()
Protected constructor; not for application use.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disableMocaPrivacy(NetworkInterface networkInterface)
Disables MoCA privacy.
|
void |
enableMocaPrivacy(NetworkInterface networkInterface)
Enables MoCa privacy.
|
static NetSecurityManager |
getInstance()
Get the network security manager.
|
String |
getNetworkPassword(NetworkInterface networkInterface)
Gets a network interface password.
|
boolean |
queryTransaction(String actionName,
InetAddress inetAddress,
String macAddress,
URL url,
int activityID)
Queries the implementation to determine if it has sent a transaction
matching the parameters.
|
void |
revokeAuthorization(int activityID)
Revokes a session authorization granted by the authorization handler.
|
void |
setAuthorizationHandler(NetAuthorizationHandler nah)
Registers an authorization handler.
|
void |
setAuthorizationHandler(NetAuthorizationHandler2 nah,
String[] actionNames,
boolean notifyTransportRequests)
Registers an authorization handler.
|
void |
setAuthorizationHandler(NetAuthorizationHandler nah,
String[] actionNames,
boolean notifyTransportRequests)
Registers an authorization handler.
|
void |
setNetworkPassword(NetworkInterface networkInterface,
String password)
Sets a network interface password.
|
protected NetSecurityManager()
public static NetSecurityManager getInstance()
public String getNetworkPassword(NetworkInterface networkInterface)
networkInterface - The interface to get the password for.setNetworkPassword method.UnsupportedOperationException - if a password cannot be retrieved for
the network interface.SecurityException - if the caller has not been
granted MonitorAppPermission("handler.homenetwork").public void setNetworkPassword(NetworkInterface networkInterface, String password)
enableMocaPrivacy method. If the interface type
is MoCA and the parameter is acceptable this method writes the
corresponding mocaIfPassword MIB.networkInterface - The home network interface the password is
to be set for.password - The value of the password to set.IllegalArgumentException - if the password format
is invalid for the interface type. A password for a MoCA interface
that is less than 12 characters or greater than 17 characters or
has any non-numerical characters is invalid.UnsupportedOperationException - if a password cannot be set for
the network interface.SecurityException - if the caller has not been
granted MonitorAppPermission("handler.homenetwork").public void setAuthorizationHandler(NetAuthorizationHandler nah)
nah parameter
is null, any previously registered handler is removed.
A call to this method is equivalent to calling
setAuthorizationHandler(nah, actionNames, true),
where actionNames is an empty array.
nah - The network authorization handler to register.SecurityException - if the caller does not have
MonitorAppPermission("handler.homenetwork").setAuthorizationHandler(NetAuthorizationHandler, String[], boolean)public void setAuthorizationHandler(NetAuthorizationHandler nah, String[] actionNames, boolean notifyTransportRequests)
nah parameter
is null, any previously registered handler is removed.
The actionNames parameter permits the caller to specify
an array of names indicating the actions that the handler wishes
to authorize; an empty array indicates that
NetAuthorizationHandler.notifyAction(java.lang.String, java.net.InetAddress, java.lang.String, int) will not be called.
The notifyTransportRequests parameter permits the caller to
control whether NetAuthorizationHandler.notifyActivityStart(java.net.InetAddress, java.lang.String, java.net.URL, int)
is called for every transport protocol (e.g., HTTP, RTP/RTSP)
request in the session or only the initial one.
nah - The network authorization handler to register.actionNames - An array of action names the hander is interested in
authorizing. The format of the names is out-of-scope for this
definition.notifyTransportRequests - If true,
NetAuthorizationHandler.notifyActivityStart(java.net.InetAddress, java.lang.String, java.net.URL, int) is always
called when a transport protocol message is received;
if false, NetAuthorizationHandler.notifyActivityStart(java.net.InetAddress, java.lang.String, java.net.URL, int)
is only called for the first message in a session.SecurityException - if the caller does not have
MonitorAppPermission("handler.homenetwork").IllegalArgumentException - if the actionNames parameter contains
a name that cannot be matched to a known action.public void setAuthorizationHandler(NetAuthorizationHandler2 nah, String[] actionNames, boolean notifyTransportRequests)
NetAuthorizationHander2 parameter which provides additional
information about the activity to the notify methods.
If a handler is already registered
(whether a NetAuthorizationHandler or NetAuthorizationHandler2)
this method SHALL replace it. If the nah parameter
is null, any previously registered handler is removed.
The actionNames parameter permits the caller to specify
an array of names indicating the actions that the handler wishes
to authorize; an empty array indicates that
NetAuthorizationHandler2.notifyAction(java.lang.String, java.net.InetAddress, int, java.lang.String[], org.ocap.hn.NetworkInterface) will not be called.
The notifyTransportRequests parameter permits the caller to
control whether NetAuthorizationHandler2.notifyActivityStart(java.net.InetAddress, java.net.URL, int, org.ocap.hn.content.ContentEntry, java.lang.String[], org.ocap.hn.NetworkInterface)
is called for every transport protocol (e.g., HTTP, RTP/RTSP)
request in the session or only the initial one.
nah - The network authorization handler to register.actionNames - An array of action names the hander is interested in
authorizing. The format of the names is out-of-scope for this
definition.notifyTransportRequests - If true,
NetAuthorizationHandler2.notifyActivityStart(java.net.InetAddress, java.net.URL, int, org.ocap.hn.content.ContentEntry, java.lang.String[], org.ocap.hn.NetworkInterface) is always
called when a transport protocol message is received;
if false, NetAuthorizationHandler2.notifyActivityStart(java.net.InetAddress, java.net.URL, int, org.ocap.hn.content.ContentEntry, java.lang.String[], org.ocap.hn.NetworkInterface)
is only called for the first message in a session.SecurityException - if the caller does not have
MonitorAppPermission("handler.homenetwork").IllegalArgumentException - if the actionNames parameter contains
a name that cannot be matched to a known action.public void revokeAuthorization(int activityID)
activityID - The activity identifier that was passed
to the authorization handler's notifyActivityStart method.SecurityException - if the caller does not have
MonitorAppPermission("handler.homenetwork").public boolean queryTransaction(String actionName, InetAddress inetAddress, String macAddress, URL url, int activityID)
actionName - Name of the request type if known. If not known an
empty string MAY be used. The format of the name is out-of-scope
of this definition.inetAddress - IP address the transaction was sent to.macAddress - MAC address the transaction was sent from if known.
Can be empty String if not known. The format is
EUI-48 with 6 colon separated 2 digit bytes in hexadecimal notation
with no leading "0x", e.g. "00:11:22:AA:BB:CC".url - The URL requested by the transaction if known. If not known
an empty string may be used.activityID - The activity identifier this device set for the
connection. A value of -1 indicates the parameter will not be
used for transaction matching purposes.IllegalArgumentException - if the MAC address is malformed.SecurityException - if the caller does not
have MonitorAppPermission("handler.homenetwork").public void enableMocaPrivacy(NetworkInterface networkInterface)
networkInterface - Interface to enable privacy on.UnsupportedOperationException - if the parameter interface is not
a MoCA interface type.SecurityException - if the caller has not been
granted MonitorAppPermission("handler.homenetwork").public void disableMocaPrivacy(NetworkInterface networkInterface)
networkInterface - Interface to disable privacy on.UnsupportedOperationException - if the parameter interface is not
a MoCA interface type.SecurityException - if the caller has not been
granted MonitorAppPermission("handler.homenetwork").Copyright © 2013 CableLabs. All rights reserved.