Javax.security package ?? Key

Hi..
It's my first time to mess around with the
javax.crypto package. this is what i've done till now..
/CODE/
import java.security.AlgorithmParameters;
import javax.crypto.*;
try
Cipher cipher = Cipher.getInstance("DES");
cipher.init(Cipher.ENCRYPT_MODE, ---------);
catch(NoSuchPaddingException Padding_ex)
catch(java.security.NoSuchAlgorithmException Algo_ex)
/CODE/
Now while initializing the Cipher object what should be put in the Key parameter ???
Do i have to create one, a key generator, and if yes how ?? I'm doing this for the purpose of encrypting a String that iv'e entered then decrypt it ...

you need to create a Key first i.e
so in the method you will pass key of type SecretKey
Create a key and store it in a file as below
==================================
Provider sunJce = new com.sun.crypto.provider.SunJCE();
Security.addProvider(sunJce);
//create key generator
KeyGenerator generator = KeyGenerator.getInstance(keyType);
generator.init(168, new SecureRandom()); //using 168 bit keys; key size must be either 112 or 168
//generate key
Key key = generator.generateKey();
//write key to file
ObjectOutputStream outStream = new ObjectOutputStream(new FileOutputStream(workingFile.getCanonicalPath()));
outStream.writeObject(key);
outStream.close();

Similar Messages

  • !! Warning on javax.security classes !!

    WARNING: be aware that weblogic.jar in WLS 6.1 contains at least one class
    from the javax.security package that has been customized by Bea and is
    significantly different (i.e. incompatible) from the class provided in the
    'official' Sun J2EE library.
    The particular class we have examined is javax.security.auth.Subject, which
    is used to carry security details for a subject (person, etc). This is used
    when authenticating client log-ins with WebLogic server security. No doubt
    Bea obtained permission from Sun to break the usual licence agreements and
    release a custom version of the class in the same package, but this seems to
    negate the whole concept of Java packages and has cost us a lot of time and
    expense to unravel.
    We have spent considerable time trying to trace the cause of an
    IncompatibleClassException thrown by WLS when our clients attempted to
    log-in. We eventually discovered that the server was picking up the
    'official' Sun version of javax.security.auth.Subject.class from the Java
    bootclasspath, whereas the clients were sending the WebLogic custom version
    of javax.security.auth.Subject.class from weblogic.jar. The two versions are
    terminally incompatible.
    I would be interested to hear a realistic justification for this kind of
    package abuse...
    Dave

    Hi
    Frank reply is as follows
    Hi,
    ADF UI components use peer classes to adopt to different browser behaviors. The request issued by ADF Faces for its server communication is through the XMLHttpRequest object (unless its a GET request for the initial page load. All subsequent requestst are either partial XMLHttpRequest requests of JSF postback requests)
    Frank
    I am not able to understand the solution what is he trying to say.. Could you please explain like what should i change in my code to avoid that security error
    Regards
    Zarrakh

  • Why javax.security.* doesn't work for me ?

    I am newbie in Java. Recently I met a problem which confused my a lot. I am a class named CSecurity which can throw LoginException. Code sample is
    public class CSecurity
    userLogin() throws LoginException
    When compiling it, "unresolved symbol - Can't locate LoginException class" error message appears, although I put "import javax.security.*;" in the front. Compilation succeeds, if I change it to "import javax.security.auth.login.LoginException;". My question is why character "*" doesn't work at all, since it is supposed to work. I assume "import javax.security.*;" should import all class under security branch. Am I wrong about this ?
    Regards,
    WenBin

    when you import * it doesn't import sub packages, only the specified one.
    so you would need to do..
    import javax.security.auth.login.*;

  • Entry for host name is missing or empty (Secure Store key: admin/host/).

    Hi All,
    I am in the process of installing EP7 on SLES9 and MaxDB 7.6 on a clustered HA environment where the SCS, DB and JC components are installed under and referenced by their virtual hostname (eg. sapinst SAPINST_USE_HOSTNAME <virt name>).
    The SCS instance is installed, the Database Instance is installed and I'm currently in the process of Installing the JC and Deploying the EP packages. 
    During the installation, SDM is put into standalone mode and sapinst tries to deploy the package EPBC06_0.SCA where it fails and the sdm_server.err shows :
    "com.sap.sdm.serverext.servertype.inqmy.TargetEngineConfigurationException: Cannot retrieve Engine logon data from Secure Store: Entry for host name is missing or empty (Secure Store key: admin/host/).        at com.sap.sdm.serverext.servertype.inqmy.InQMyTargetSystemConfigurator.getLoginDataFromSecStoreInQMyTargetSystemConfigurator.java:286)        at com.sap.sdm.serverext.servertype.inqmy.InQMyTargetSystemConfigurator.getEngineLoginDataInQMyTargetSystemConfigurator.java:197)        at com.sap.sdm.serverext.servertype.inqmy.EngineStateServiceImpl.determineCurrentEngineStateEngineStateServiceImpl.java:53)        at com.sap.sdm.app.proc.deployment.states.State.determineJ2EEEngineState(State.java:97)        at com.sap.sdm.app.proc.deployment.states.StateBeforeFirstDeployment.getJ2EEEngineStateChangeDescriptionStateBeforeFirstDeployment.java:75)        at com.sap.sdm.app.view.proc.deployment.mapper.StateMapper.map(StateMapper.java:56)        at com.sap.sdm.app.view.proc.deployment.mapper.FlowMapper.map(FlowMapper.java:28)        at com.sap.sdm.app.view.session.AppViewUpdater.updateAppView(AppViewUpdater.java:22)        at com.sap.sdm.app.view.session.AppViewUpdater.sessionStateChanged(AppViewUpdater.java:18)        at com.sap.sdm.app.proc.deployment.impl.SessionStateObserversImpl.notifySessionStateChangedSessionStateObserversImpl.java:46)        at com.sap.sdm.app.proc.deployment.states.InstContext.processEventServerSide(InstContext.java:85)        at com.sap.sdm.app.proc.deployment.states.InstContext.processEvent(InstContext.java:59)        at com.sap.sdm.app.view.controllers.DeployEventProcessor.processEvent(DeployEventProcessor.java:11)        at com.sap.sdm.client_server.deployserver.DeployCmdProcessor.processEvent(DeployCmdProcessor.java:264)        at com.sap.sdm.client_server.deployserver.DeployCmdProcessor.process(DeployCmdProcessor.java:108)        at com.sap.sdm.gui.server.GuiAdminRoleCmdProcessor.processGuiAdminRoleCmdProcessor.java:72)        at com.sap.sdm.is.cs.session.server.SessionCmdProcessor.process(SessionCmdProcessor.java:67)        at com.sap.sdm.is.cs.cmd.server.CmdServer.execCommandCmdServer.java:76)        at com.sap.sdm.client_server.launch.ServerLauncher$ConnectionHandlerImpl.handle(ServerLauncher.java:286)        at com.sap.sdm.is.cs.ncserver.NetCommServer.serveNetCommServer.java:43)        at com.sap.sdm.is.cs.ncwrapper.impl.ServiceWrapper.serveServiceWrapper.java:39)        at com.sap.bc.cts.tp.net.Worker.run(Worker.java:50)       at java.lang.Thread.run(Thread.java:816)"
    The same problem occurs if I try to deploy this package or any other package using SDM in standalone or integrated mode. 
    configtool -> Secure Store -> admin/host/<SID> is the virtual hostname of the JC instance.
    I've tried the following to no avail:
    - Changed configtool -> Secure Store -> admin/host/<SID> to be the physical hostname of the box.
    - Changed configtool -> Server -> Dispatcher -> Service -> P4 -> bindhost (from 0.0.0.0 to JC virt IP).
    - Changed the <Host> entry in sdmrepository.sdc from <phys hostname> to <jc virt hostname>.
    The SAPLOCALHOST, SAPGLOBALHOST all seem to be set correctly in the SAP profiles.
    Has anyone had this issue?  If so, what do I need to check/change?  Any ideas?
    Notice the message does not reference the <SID> in "admin/host", could this be related to the issue?  If so, what can cause this?
    TIA
    Anthony

    Hi All,
    Just an update, I was able to get around my problems by patching the 2004s media from sp6 to sp8, uninstalling my scs, and database and re-installing from the patched media.

  • Windows 8 Remote Desktop Error "The Requested Security Package Does Not Exist"

    When my remote host (win server 2008 R2) is configured to use SSL for security layer, RDP from my Windows 8 gets  
    "An authentication error has occurred. The requested security package does not exit."
    When the host is set to use RDP security layer, it works fine. 
    Registry key solution for Win7 suggested on other posts does not seem to apply to win8.
    This is a Lenovo desktop, I uninstalled silverlight and bunch of other OEM installed programs.

    This fixed my problem in Windows 8 while connecting to a Windows 7 host.  I needed the pku2u entry.  I decided to look it up and here's the info for anyone that's interested.
    Introducing PKU2U in Windows
    Applies To: Windows 7, Windows Server 2008 R2
    This product evaluation topic for the IT professional describes the Public Key Cryptography Based User-to-User (PKU2U) security support provider (SSP) that is new in Windows 7 and Windows Server 2008 R2.
    PKU2U protocol
    The PKU2U protocol in Windows 7 and Windows Server 2008 R2 is implemented as an SSP. The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called Homegroup, which permits sharing
    between computers that are not members of a domain.
    How PKU2U works
    Windows 7 and Windows Server 2008 R2 introduce an extension to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decides whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate,
    Negoexts, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. You can also develop or add other SSPs.
    When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When
    validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes.
    For more information about developing SSPs, see
    Custom Security Packages in the MSDN Library.
    For more information about the Negotiate extensions (Negoexts), see
    Introducing Extensions to the Negotiate Authentication Package.

  • Javax.security.auth.login.LoginException: Cannot authenticate X509(Urgent!)

    I'm trying to sign my messages between client & webservice using X509 certificates. I've created a keystore and imported:
    privatekey1, certificate1(public key) and trustedCertAuthority that published certificates.
    I've configured webservice & client to use that keystore and privatekey1 to sign request/response, but web service keeps throwing following exception:
    javax.security.auth.login.LoginException: Cannot authenticate X509 certificate, User EMAILADDRESS=[email protected], CN=testUser, ... does not exist in our system
    How can I configure web service to find that certificate?
    Thnx for help.

    Yes, I did. I found the problem..
    I had also checked to Authenticate with X509 certificate... and obviously I should somehow set the Securtiy provider, although, I don't know how (but it's not so important right now).
    But I do have another question - how can I use private key & public key in certificate X509 to encrypt messages. In the sample you mentioned, it's written that there shoud be separate key for signature & encryption, but I have separate keystores for client (with client private key & server public certificate) and for server (with server private key & client certificate). But I can't get it to work... It seems to me that in that case signature key alias at service should be the same as key needed to decrypt the message?
    Am i missing something again?
    Thanks.

  • Security package specific error occurred when trying to connect to Orchestrator with remote Runbook Designer

    When I try to connect to Orchestrator server with Runbook Designer installed on my laptop I get an error saying "A security  package specific error occurred.".
    Entry from Designer log file is below. I've tried to set error level to 3 and 7 but got no additional info about the error. I'm unable to find any details of the error on server or client side in any logs (Event Log or Orchestrator trace logs).
    Connecting to Orchestrator Management Server with local Designer installed on the server works fine. 
    Orchestrator is installed in AD environment and security groups are properly configured.
    Can anybody help?
    2012-06-12 11:35:51 [7472] 1 Exception caught in long __cdecl `anonymous-namespace'::connectCommunicator(struct HWND__ *,const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)
    Connections.cpp(238):
    <Exception>
    <Type>Opalis::Exception</Type>
    <Location>
    void __thiscall ServiceCommunicator::connect(const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)
    ServiceCommunicator.cpp(118)
    </Location>
    <MsgCode>A security package specific error occurred.
    </MsgCode>
    </Exception>

    I'm having a similar issue with one of our runbook servers. i cannot deploy any IPs to it. I get the error "A security package specific error occurred". I can open the designer on the runbook server, connect to the management server, and look at
    runbooks. They wont run on the server without the IPs though, but it doesnt seem like a connection issue. i have also tried uninstalling/re-installing the runbook server and i get the same. 
    Has anybody else run into this? 
    Edit:
    Heres an error fromthe event log:
    The Kerberos client received a KRB_AP_ERR_MODIFIED error from the server <Service Account>. The target name used was HOST/server.domain.domain.com. This indicates that the target server failed to decrypt the ticket provided by the client. This can
    occur when the target server principal name (SPN) is registered on an account other than the account the target service is using. Please ensure that the target SPN is registered on, and only registered on, the account used by the server. This error can also
    happen when the target service is using a different password for the target service account than what the Kerberos Key Distribution Center (KDC) has for the target service account. Please ensure that the service on the server and the KDC are both updated to
    use the current password. If the server name is not fully qualified, and the target domain (domain.domain.COM) is different from the client domain (domain.domain.COM), check if there are identically named server accounts in these two domains, or use the fully-qualified
    name to identify the server.
    So maybe I was just given the wrong account.
    - Slow is smooth and smooth is fast.

  • Javax.* packages not available under JavaFX

    Where are the javax.* packages in JavaFX. I want to use some existing libraries that use javax.crypto.* but these packages are not in the rt15.jar??

    Just to add some more background.... many of the more popular public APIs use security based on HMAC signatures (e.g. Amazon, Google GData). Typically you use javax.crypto.Mac, javax.crytpo.SecretKey and javax.crypto.spec.SecretKeySpec to implement HMAC.

  • What is the best security package for an imac using yosimity

    What is the best security package for an imac using Yosimity

    Mac users often ask whether they should install "anti-virus" software. The answer usually given on ASC is "no." The answer is right, but it may give the wrong impression that there is no threat from what are loosely called "viruses." There  is a threat, and you need to educate yourself about it.
    1. This is a comment on what you should—and should not—do to protect yourself from malicious software ("malware") that circulates on the Internet and gets onto a computer as an unintended consequence of the user's actions. It does not apply to software, such as keystroke loggers, that may be installed deliberately by an intruder who has hands-on access to the computer, or who has been able to take control of it remotely. That threat is in a different category, and there's no easy way to defend against it.
    The comment is long because the issue is complex. The key points are in sections 5, 6, and 10.
    OS X now implements three layers of built-in protection specifically against malware, not counting runtime protections such as execute disable, sandboxing, system library randomization, and address space layout randomization that may also guard against other kinds of exploits.
    2. All versions of OS X since 10.6.7 have been able to detect known Mac malware in downloaded files, and to block insecure web plugins. This feature is transparent to the user. Internally Apple calls it "XProtect."
    The malware recognition database used by XProtect is automatically updated; however, you shouldn't rely on it, because the attackers are always at least a day ahead of the defenders.
    The following caveats apply to XProtect:
    ☞ It can be bypassed by some third-party networking software, such as BitTorrent clients and Java applets.
    ☞ It only applies to software downloaded from the network. Software installed from a CD or other media is not checked.
    As new versions of OS X are released, it's not clear whether Apple will indefinitely continue to maintain the XProtect database of older versions such as 10.6. The security of obsolete system versions may eventually be degraded. Security updates to the code of obsolete systems will stop being released at some point, and that may leave them open to other kinds of attack besides malware.
    3. Starting with OS X 10.7.5, there has been a second layer of built-in malware protection, designated "Gatekeeper" by Apple. By default, applications and Installer packages downloaded from the network will only run if they're digitally signed by a developer with a certificate issued by Apple. Software certified in this way hasn't necessarily been tested by Apple, but you can be reasonably sure that it hasn't been modified by anyone other than the developer. His identity is known to Apple, so he could be held legally responsible if he distributed malware. That may not mean much if the developer lives in a country with a weak legal system (see below.)
    Gatekeeper doesn't depend on a database of known malware. It has, however, the same limitations as XProtect, and in addition the following:
    ☞ It can easily be disabled or overridden by the user.
    ☞ A malware attacker could get control of a code-signing certificate under false pretenses, or could simply ignore the consequences of distributing codesigned malware.
    ☞ An App Store developer could find a way to bypass Apple's oversight, or the oversight could fail due to human error.
    Apple has taken far too long to revoke the codesigning certificates of some known abusers, thereby diluting the value of Gatekeeper and the Developer ID program. Those lapses don't involve App Store products, however.
    For the reasons given, App Store products, and—to a lesser extent—other applications recognized by Gatekeeper as signed, are safer than others, but they can't be considered absolutely safe. "Sandboxed" applications may prompt for access to private data, such as your contacts, or for access to the network. Think before granting that access. Sandbox security is based on user input. Never click through any request for authorization without thinking.
    4. Starting with OS X 10.8.3, a third layer of protection has been added: a "Malware Removal Tool" (MRT). MRT runs automatically in the background when you update the OS. It checks for, and removes, malware that may have evaded the other protections via a Java exploit (see below.) MRT also runs when you install or update the Apple-supplied Java runtime (but not the Oracle runtime.) Like XProtect, MRT is effective against known threats, but not against unknown ones. It notifies you if it finds malware, but otherwise there's no user interface to MRT.
    5. The built-in security features of OS X reduce the risk of malware attack, but they are not, and never will be, complete protection. Malware is a problem of human behavior, not machine behavior, and no technological fix alone is going to solve it. Trusting software to protect you will only make you more vulnerable.
    The best defense is always going to be your own intelligence. With the possible exception of Java exploits, all known malware circulating on the Internet that affects a fully-updated installation of OS X 10.6 or later takes the form of so-called "Trojan horses," which can only have an effect if the victim is duped into running them. The threat therefore amounts to a battle of wits between you and Internet criminals. If you're better informed than they think you are, you'll win. That means, in practice, that you always stay within a safe harbor of computing practices. How do you know when you're leaving the safe harbor? Below are some warning signs of danger.
    Software from an untrustworthy source
    ☞ Software with a corporate brand, such as Adobe Flash Player, doesn't come directly from the developer’s website. Do not trust an alert from any website to update Flash, or your browser, or any other software. A genuine alert that Flash is outdated and blocked is shown on this support page. Follow the instructions on the support page in that case. Otherwise, assume that the alert is fake and someone is trying to scam you into installing malware. If you see such alerts on more than one website, ask for instructions.
    ☞ Software of any kind is distributed via BitTorrent, or Usenet, or on a website that also distributes pirated music or movies.
    ☞ Rogue websites such as Softonic, Soft32, and CNET Download distribute free applications that have been packaged in a superfluous "installer."
    ☞ The software is advertised by means of spam or intrusive web ads. Any ad, on any site, that includes a direct link to a download should be ignored.
    Software that is plainly illegal or does something illegal
    ☞ High-priced commercial software such as Photoshop is "cracked" or "free."
    ☞ An application helps you to infringe copyright, for instance by circumventing the copy protection on commercial software, or saving streamed media for reuse without permission. All "YouTube downloaders" are in this category, though not all are necessarily malicious.
    Conditional or unsolicited offers from strangers
    ☞ A telephone caller or a web page tells you that you have a “virus” and offers to help you remove it. (Some reputable websites did legitimately warn visitors who were infected with the "DNSChanger" malware. That exception to this rule no longer applies.)
    ☞ A web site offers free content such as video or music, but to use it you must install a “codec,” “plug-in,” "player," "downloader," "extractor," or “certificate” that comes from that same site, or an unknown one.
    ☞ You win a prize in a contest you never entered.
    ☞ Someone on a message board such as this one is eager to help you, but only if you download an application of his choosing.
    ☞ A "FREE WI-FI !!!" network advertises itself in a public place such as an airport, but is not provided by the management.
    ☞ Anything online that you would expect to pay for is "free."
    Unexpected events
    ☞ A file is downloaded automatically when you visit a web page, with no other action on your part. Delete any such file without opening it.
    ☞ You open what you think is a document and get an alert that it's "an application downloaded from the Internet." Click Cancel and delete the file. Even if you don't get the alert, you should still delete any file that isn't what you expected it to be.
    ☞ An application does something you don't expect, such as asking for permission to access your contacts, your location, or the Internet for no obvious reason.
    ☞ Software is attached to email that you didn't request, even if it comes (or seems to come) from someone you trust.
    I don't say that leaving the safe harbor just once will necessarily result in disaster, but making a habit of it will weaken your defenses against malware attack. Any of the above scenarios should, at the very least, make you uncomfortable.
    6. Java on the Web (not to be confused with JavaScript, to which it's not related, despite the similarity of the names) is a weak point in the security of any system. Java is, among other things, a platform for running complex applications in a web page, on the client. That was always a bad idea, and Java's developers have proven themselves incapable of implementing it without also creating a portal for malware to enter. Past Java exploits are the closest thing there has ever been to a Windows-style virus affecting OS X. Merely loading a page with malicious Java content could be harmful.
    Fortunately, client-side Java on the Web is obsolete and mostly extinct. Only a few outmoded sites still use it. Try to hasten the process of extinction by avoiding those sites, if you have a choice. Forget about playing games or other non-essential uses of Java.
    Java is not included in OS X 10.7 and later. Discrete Java installers are distributed by Apple and by Oracle (the developer of Java.) Don't use either one unless you need it. Most people don't. If Java is installed, disable it—not JavaScript—in your browsers.
    Regardless of version, experience has shown that Java on the Web can't be trusted. If you must use a Java applet for a task on a specific site, enable Java only for that site in Safari. Never enable Java for a public website that carries third-party advertising. Use it only on well-known, login-protected, secure websites without ads. In Safari 6 or later, you'll see a padlock icon in the address bar when visiting a secure site.
    Stay within the safe harbor, and you’ll be as safe from malware as you can practically be. The rest of this comment concerns what you should not do to protect yourself.
    7. Never install any commercial "anti-virus" (AV) or "Internet security" products for the Mac, as they are all worse than useless. If you need to be able to detect Windows malware in your files, use one of the free security apps in the Mac App Store—nothing else.
    Why shouldn't you use commercial AV products?
    ☞ To recognize malware, the software depends on a database of known threats, which is always at least a day out of date. This technique is a proven failure, as a major AV software vendor has admitted. Most attacks are "zero-day"—that is, previously unknown. Recognition-based AV does not defend against such attacks, and the enterprise IT industry is coming to the realization that traditional AV software is worthless.
    ☞ Its design is predicated on the nonexistent threat that malware may be injected at any time, anywhere in the file system. Malware is downloaded from the network; it doesn't materialize from nowhere. In order to meet that nonexistent threat, commercial AV software modifies or duplicates low-level functions of the operating system, which is a waste of resources and a common cause of instability, bugs, and poor performance.
    ☞ By modifying the operating system, the software may also create weaknesses that could be exploited by malware attackers.
    ☞ Most importantly, a false sense of security is dangerous.
    8. An AV product from the App Store, such as "ClamXav," has the same drawback as the commercial suites of being always out of date, but it does not inject low-level code into the operating system. That doesn't mean it's entirely harmless. It may report email messages that have "phishing" links in the body, or Windows malware in attachments, as infected files, and offer to delete or move them. Doing so will corrupt the Mail database. The messages should be deleted from within the Mail application.
    An AV app is not needed, and cannot be relied upon, for protection against OS X malware. It's useful, if at all, only for detecting Windows malware, and even for that use it's not really effective, because new Windows malware is emerging much faster than OS X malware.
    Windows malware can't harm you directly (unless, of course, you use Windows.) Just don't pass it on to anyone else. A malicious attachment in email is usually easy to recognize by the name alone. An actual example:
    London Terror Moovie.avi [124 spaces] Checked By Norton Antivirus.exe
    You don't need software to tell you that's a Windows trojan. Software may be able to tell you which trojan it is, but who cares? In practice, there's no reason to use recognition software unless an organizational policy requires it. Windows malware is so widespread that you should assume it's in every email attachment until proven otherwise. Nevertheless, ClamXav or a similar product from the App Store may serve a purpose if it satisfies an ill-informed network administrator who says you must run some kind of AV application. It's free and it won't handicap the system.
    The ClamXav developer won't try to "upsell" you to a paid version of the product. Other developers may do that. Don't be upsold. For one thing, you should not pay to protect Windows users from the consequences of their choice of computing platform. For another, a paid upgrade from a free app will probably have all the disadvantages mentioned in section 7.
    9. It seems to be a common belief that the built-in Application Firewall acts as a barrier to infection, or prevents malware from functioning. It does neither. It blocks inbound connections to certain network services you're running, such as file sharing. It's disabled by default and you should leave it that way if you're behind a router on a private home or office network. Activate it only when you're on an untrusted network, for instance a public Wi-Fi hotspot, where you don't want to provide services. Disable any services you don't use in the Sharing preference pane. All are disabled by default.
    10. As a Mac user, you don't have to live in fear that your computer may be infected every time you install software, read email, or visit a web page. But neither can you assume that you will always be safe from exploitation, no matter what you do. Navigating the Internet is like walking the streets of a big city. It can be as safe or as dangerous as you choose to make it. The greatest harm done by security software is precisely its selling point: it makes people feel safe. They may then feel safe enough to take risks from which the software doesn't protect them. Nothing can lessen the need for safe computing practices.

  • How can I use the security package in JCOP41V2.2?

    Hi all, I'm a newbie in javacard programming. I'm trying to develop a project with RSA_signature. But I found, the exception NO_SUCH_ALGORITHM will be thrown out when I new an instance of KeyPair.
    My java file Temp_1.java following:
    package temp;
    import javacard.framework.Applet;
    import javacard.framework.ISO7816;
    import javacard.framework.ISOException;
    import javacard.framework.APDU;
    import javacard.security.*;
    * @author lujj
    public class Temp_1 extends Applet {
    KeyPair myKeyPair = null;
         public static void install(byte[] bArray, short bOffset, byte bLength) {
              // GP-compliant JavaCard applet registration
              new Temp_1().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
         public void process(APDU apdu) throws ISOException{
              // Good practice: Return 9000 on SELECT
              if (selectingApplet()) {
                   return;
              byte[] buf = apdu.getBuffer();
              if(buf[ISO7816.OFFSET_CLA] == (byte)0xEE)
                   try
                        myKeyPair = new KeyPair(KeyPair.ALG_RSA, KeyBuilder.LENGTH_RSA_1024);
                   catch(CryptoException e)
                        ISOException.throwIt((short)(0x6F00+e.getReason()));                    
                   return;
              switch (buf[ISO7816.OFFSET_INS]) {
              case (byte) 0x00:
                   break;
              default:
                   // good practice: If you don't know the INStruction, say so:
                   ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    This package can be upload and the applet can be installed successfully.
    But if I send the apdu "EE 00 00 00 00" after selected the applet, "6F 03" will be returned.
    Is there anyone can help me? Thanks a lot.

    Thank you so much~
    Actually, it's only an applet for test. I cannot get the error code if I new the KeyPair in install function or Applet construct function. It will return "6A 80" when install the applet.
    And, I found that it support few algorithm. For example, it does not support ALG_DES_MAC4_ISO9797_M2,etc. Is there anything I can do if I want to use the algorithm? Shall I rewrite security package by myself?
    5555, security package is the standard package in JAVACARD API 2.1.1.

  • OIM 9.1.0.1 on JBOSS 4.2.3GA  javax.security.auth.login.LoginException: jav

    ERROR,11 Feb 2009 15:39:42,453,[XELLERATE.JBOSSLOGINHANDLER],Error in creating l
    ogin context
    javax.security.auth.login.LoginException: java.lang.NoSuchFieldError: TRACE
    at org.jboss.logging.Log4jLoggerPlugin.isTraceEnabled(Log4jLoggerPlugin.
    java:85)
    at org.jboss.logging.Logger.isTraceEnabled(Logger.java:122)
    at org.jboss.security.ClientLoginModule.initialize(ClientLoginModule.jav
    a:96)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:1
    86)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:6
    80)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
    at Thor.API.Security.LoginHandler.jbossLoginHandler.login(Unknown Source
    at Thor.API.Security.ClientLoginUtility.login(Unknown Source)
    at com.thortech.xl.client.base.tcAppWindow.internalLogin(Unknown Source)
    at com.thortech.xl.client.base.tcAppWindow.login(Unknown Source)
    at com.thortech.xl.client.base.tcAppWindow.<init>(Unknown Source)
    at com.thortech.xl.client.base.tcAppWindow.main(Unknown Source)

    Backup the original file log4j-1.2.8.jar in oimclient/xlclient/ext
    copy the log4j.jar from JBOSS folder - JBOSS/server/default
    Paste the file in client folder with original log4j-1.2.8.jar
    Rename log4j.jar file to log4j-1.2.8.jar
    start ur JBOSS.. this shd work.
    AKSHAY
    Edited by: user640639 on Feb 11, 2009 12:20 PM

  • Error when using javax.script package

    Hi
    I want to call a javascript method from a .js file from .java class.
    when i searched, i came to understand that using jdk1.6 i can use javax.script package tht provide me what i needed.
    using the reply i got from i earlier post, i tried one example.
    public void show() {
    ScriptEngineManager engineMgr = new ScriptEngineManager();
    ScriptEngine engine= engineMgr.getEngineByName("JavaScript");
    try {
    engine.eval(new FileReader("D:/ShowScript.js"));
    Invocable invocableEngine = (Invocable) engine;
    //show_message is my function in ShowScript.js file
    invocableEngine.invokeFunction("show_message",null);
    } catch (Exception e) {
    e.printStackTrace();
    ShowScript.js
    function show_message()
    println("===> hi");
    alert("hi");
    When i execute my program, im getting the following error
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "alert" is not defined. ( #8) in at line number 8
    at com.sun.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:184)
    at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(RhinoScriptEngine.java:142)
    at testbuiltin.backing.Show_alert.show(Show_alert.java:81)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    When i remove the alert() from the js file, the println is working. But what i neede is the alert.
    Can anyone plz help me to solve this problem.

    As you're talking about "backing beans", are you using JSF?
    After all, this is definitely not the way to let Java and JS interact with each other. Java runs at the server side. JS runs at the client side. Java can write JS code to the response, but definitely cannot call it. JS can access the HTML DOM and invoke requests to the server (form.submit() and AJAX and so on) and send parameters along the request, but definitely cannot call Java classes and methods independently. Nothing more and nothing less than that.

  • SharePoint Reporting Services, No Credentials are available in the security package

    Hi all, 
    I have problem to solve regarding rendering Reports inside SharePoint. Scenario as follows.
    1. There are two domains with two-way trusted connections. We have confirmed it finding users for both domains in the people pickers
    2. Kerberos has been configured in SharePoint
    3. Users from the domain that SharePoint is installed can render reports inside SharePoint but users from the other domain get following error when they try render reports.
    4. users from the other domain can render reports when they browse direclty to the admin tool of reporting-services server.
    5. users from the other domain can run klist and get a about 15 tickets.
    this is the error the users from the domain get when they try render report inside SharePoint.
    An Error has occured during reporting processing (rsProcessingAborted)
       Cannot create a connection to data source 'theSourceSSAS' (rsErrorOpeningConnectiong)
         Authentication failed
            No Credentials are available in the security package
    Thank you very much for your help and appreciate all kind of advice.

    Hi Medes,
    From the error message, it seems that the issue is due to the accounts in another domain has no permission to access the data source theSourceSSAS.
    I recommend to use Stored credential when creating the data source and then check the results.
    Please also check if the Claims to Windows Token Service is running with Local System account.
    If not, please make sure that the account running this service has the permission below:
    Act as part of the operating system.
    Impersonate a client after authentication.
    Log on as a service.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Using javax.security.auth.LoginContext to generate a renewable ticket

    Hi,
    I tired to use javax.security.auth.LoginContext (with kerberos) to generate a forwardable and renewable ticket. With this ticket I authenticate the user at an other server.
    My problem is, that the code generates a forwardable ticket, but not a renewable one. If I use the kinit (console tool) I am able to generate a renewable one.
    Here is the JAVA-code:
    System.setProperty("sun.security.krb5.debug","true");
    System.setProperty("java.security.krb5.conf", "krb5.conf");     
    System.setProperty("java.security.auth.login.config", "login.conf");
    lc = new LoginContext("SampleCXF",new LoginGuiCallbackHandler());
    try {
         lc.login();
    }catch(Exception e) {
         e.printStackTrace();
         System.exit(1);
         Subject subject = lc.getSubject();
         KerberosTicket kt = (KerberosTicket) subject.getPrivateCredentials().iterator().next();
         System.out.println(kt);
         Subject.doAsPrivileged(subject, new PrivilegedAction<byte[]>() {
              @Override
              public byte[] run() {
                   try {
                        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
                        factory.setServiceClass(TestService.class);
                        factory.setAddress("https://server.at/TestProjektServer/services/TestService");
                        TestService client = (TestService) factory.create();
                        String message = client.service1("param service 1");
                        //String message = client.service1("param service 1");
                   }catch(Exception e) {
                        e.printStackTrace();
                   return null;
         }, null);
    the login.conf contains:
    SampleCXF {
    com.sun.security.auth.module.Krb5LoginModule required useTicketCache=true debug=true renewTGT=true doNotPront=true;
    the krb5.conf contains:
    [libdefaults]
    default_realm = TESTREALM
         kinit = {
         forwardable = true
         proxiable = true
         renew_lifetime = 5d 0h 0m 0s
    [realms]
    TESTREALM = {
    kdc = aba.hostingcenter.uclv.net
    admin_server = aba.hostingcenter.uclv.net
    [domain_realm]
    *.test.net = TESTREALM
    .test.net = TESTREALM
    [logging]
         default = FILE:/var/log/kdc.log
         kdc = FILE:/var/log/kdc.log
    [appdefaults]
         pam = {
              renewable = true
         forwardable = true
         renew_lifetime = 5d 0h 0m 0s
    If I use my client principal and password a ticket will be generated. This ticket is not renewable!!
    If I use the ticket cache (kinit -r, and kinit -R), a renewable ticket was loaded. On the server side the forwarded ticket is not renewable. It seams that the client generates a new ticket with the forwarded flag, but the renewable flag is not set.
    does anyone have an idea?
    Thanks a lot
    Ludi
    Edited by: user6714014 on Dec 13, 2011 7:34 AM

    nobody knows?

  • Error using javax.mail package

    Hi,
    I have included the package javax.mail.* in my code.I have downloaded
    jaf 1.0.2 and javamail 1.1.3 from the Sun Microsystems website.
    When i try to compile my code i get the error message:
    com/voxspectrum/ccvox/EmailServer.java:55: cannot resolve symbol
    symbol : class MimeMessage
    location: class com.voxspectrum.ccvox.EmailServer
    javax.mail.Message msg = new MimeMessage(session);
    I am using JDK ver 1.3.1_02. What should i set my path and classpath as, if i am using javax.mail package?
    Please could you help me out with this problem!

    Hi Nisha
    You need to include the path to the mail.jar and activation.jar files in your classpath.
    How you do it depends on the OS you are running on
    in Windows 95 /98 the easiest way is to edit the autoexec.bat file and add the settings to your already existing classpath statement i.e.
    set CLASSPATH=%CLASSPATH%;C:\richard\javamail-1.3\mail.jar C:\richard\jaf-1.0.2\activation.jar
    (excuse the word wrapping) then reboot
    on Linux / Solaris edit the .profile file for your user and set the CLASSPATH variable to
    CLASSPATH=$CLASSPATH:<pathtofile>/mail.jar:<pathtofile>/activation.jar
    export CLASSPATH
    and that should do it
    Hope this helps

Maybe you are looking for